Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pynvrtc: 'Program' object has no attribute '_program' #21

Closed
Jiankai-Sun opened this issue Aug 1, 2018 · 1 comment
Closed

pynvrtc: 'Program' object has no attribute '_program' #21

Jiankai-Sun opened this issue Aug 1, 2018 · 1 comment

Comments

@Jiankai-Sun
Copy link

Firstly, thank you for your great work!

Following your README.md, I installed the s2cnn successfully.

However, when I run example/equivariance_error.py, error occurs:

(cuda9) jiankai@fibonacci:~/data/Applications/s2cnn/examples/equivariance_error$ python main.py 
compute 0.pkl.gz... save 0.pkl.gz... done
Traceback (most recent call last):
  File "main.py", line 40, in <module>
    y = phi(x)
  File "main.py", line 27, in phi
    x = s2_conv(x)
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/s2cnn-1.0.0-py3.6.egg/s2cnn/soft/s2_conv.py", line 40, in forward
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/s2cnn-1.0.0-py3.6.egg/s2cnn/soft/s2_fft.py", line 251, in forward
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/s2cnn-1.0.0-py3.6.egg/s2cnn/soft/s2_fft.py", line 28, in s2_fft
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/s2cnn-1.0.0-py3.6.egg/s2cnn/soft/s2_fft.py", line 52, in _s2_fft
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/s2cnn-1.0.0-py3.6.egg/s2cnn/soft/s2_fft.py", line 201, in _setup_s2fft_cuda_kernel
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/s2cnn-1.0.0-py3.6.egg/s2cnn/utils/cuda.py", line 20, in compile_kernel
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/pynvrtc/compiler.py", line 52, in __init__
    include_names)
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/pynvrtc/interface.py", line 200, in nvrtcCreateProgram
    c_char_p(encode_str(src)), c_char_p(encode_str(name)),
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/pynvrtc/interface.py", line 54, in encode_str
    return s.encode("utf-8")
AttributeError: 'bytes' object has no attribute 'encode'
Exception ignored in: <bound method Program.__del__ of <pynvrtc.compiler.Program object at 0x7f9070bdb550>>
Traceback (most recent call last):
  File "/home/jiankai/miniconda3/envs/cuda9/lib/python3.6/site-packages/pynvrtc/compiler.py", line 56, in __del__
    self._interface.nvrtcDestroyProgram(self._program)
AttributeError: 'Program' object has no attribute '_program'

It seems that this problem is caused by pynvrtc, do you have any suggestions?

Thank you!

@mariogeiger
Copy link
Collaborator

mariogeiger commented Aug 1, 2018

Thank you for reporting this issue.

Fixed in facdf5c
Apparently, the library pynvrtc changed, now they require str instead of bytes for the code and the filename.

Here is the commit NVIDIA/pynvrtc@6417a28

nkcr added a commit to nkcr/pytorch-qrnn that referenced this issue Dec 13, 2018
Leaving this fix here in case someone tries to run it with python3 and recent librairies. The error I encountered was ` 'Program' object has no attribute '_program'`, which was caused by the latest version of `pynvrtc`.

More details:  
jonkhler/s2cnn#21 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants