Code Monkey home page Code Monkey logo

Comments (6)

zhanghang1989 avatar zhanghang1989 commented on June 26, 2024

Are you running the script in the repo base folder? Try to run it in different folder.

from pytorch-encoding.

mario98 avatar mario98 commented on June 26, 2024

No, this is not the issue here. I'm running my script from a separate folder, say /home/<user>/code. But thanks for having a look at this. I'll keep you updated when I found something that could be responsible for this issue.
Is it intentional that the folder /home/<user>/.conda/envs/pytorch-0.3.1-3.5-s/lib/python3.5/site-packages/encoding/_ext does not contain any .py files?

from pytorch-encoding.

zhanghang1989 avatar zhanghang1989 commented on June 26, 2024

something wrong with the installation, there should be __init__.py automatically generated:
_encoding_lib.abi3.so* __init__.py __pycache__/

from pytorch-encoding.

mario98 avatar mario98 commented on June 26, 2024

Ok, strange. It just didn't copy the __init__.py file for some reason. I also couldn't find anything in the log files, Everything seemed to be run though without errors. I tried installation multiple times.

I ended up just copying this file manually from the sources to this directory, this solved the issue.

But now I get:

  [...]
    my_loss.backward()
  File "/home/<user>/.conda/envs/pytorch-0.3.1-3.5-s/lib/python3.5/site-packages/torch/autograd/variable.py", line 167, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, retain_variables)
  File "/home/<user>/.conda/envs/pytorch-0.3.1-3.5-s/lib/python3.5/site-packages/torch/autograd/__init__.py", line 99, in backward
    variables, grad_variables, retain_graph)
  File "/home/<user>/.conda/envs/pytorch-0.3.1-3.5-s/lib/python3.5/site-packages/torch/autograd/function.py", line 91, in apply
    return self._forward_cls.backward(self, *args)
  File "/home/<user>/.conda/envs/pytorch-0.3.1-3.5-s/lib/python3.5/site-packages/encoding/functions/syncbn.py", line 47, in backward
    gradInput, input.data.view(B, C, -1), gradSum, gradSquare)
  File "/home/<user>/.conda/envs/pytorch-0.3.1-3.5-s/lib/python3.5/site-packages/torch/utils/ffi/__init__.py", line 180, in safe_call
    result = torch._C._safe_call(*args, **kwargs)
TypeError: initializer for ctype 'struct THCudaTensor *' must be a cdata pointer, not Variable

Is this related to my incomplete installation or actually a new bug?

P.S. cffi package version 1.11.5 is installed on my system.

Edit: Solved by changing two lines of code!
It was not related to this issue, it's rather a pytorch 0.3.1 compatibility issue, I opened a new issue report for this.

And finally, the code runs on my machine! Thanks so far for all the helpful comments!

from pytorch-encoding.

zhanghang1989 avatar zhanghang1989 commented on June 26, 2024

Please checkout the newest version and see if you still have the trouble. See details in PR #51

from pytorch-encoding.

zhanghang1989 avatar zhanghang1989 commented on June 26, 2024

fixed in PR #59

from pytorch-encoding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.