Open cy69855522 opened 5 years ago
this is a result of this issue with pynvrtc:
https://github.com/taolei87/sru/issues/62
to fix this problem, go to forget_mult.py and change L102 to
program = Program(kernel, 'recurrent_forget_mult.cu')
I did that change and now I get a different error:
/opt/conda/lib/python3.6/site-packages/torchqrnn/forget_mult.py in forward(self, f, x, hidden_init)
118
119 def forward(self, f, x, hidden_init=None):
--> 120 self.compile()
121 seq_size, batch_size, hidden_size = f.size()
122 result = f.new(seq_size + 1, batch_size, hidden_size)
/opt/conda/lib/python3.6/site-packages/torchqrnn/forget_mult.py in compile(self)
100 def compile(self):
101 if self.ptx is None:
--> 102 program = Program(kernel.encode(), 'recurrent_forget_mult.cu')
103 GPUForgetMult.ptx = program.compile()
104
/opt/conda/lib/python3.6/site-packages/pynvrtc/compiler.py in __init__(self, src, name, headers, include_names, lib_name)
50 self._program = self._interface.nvrtcCreateProgram(src, name,
51 headers,
---> 52 include_names)
53
54 def __del__(self):
/opt/conda/lib/python3.6/site-packages/pynvrtc/interface.py in nvrtcCreateProgram(self, src, name, headers, include_names)
198 include_names_array[:] = encode_str_list(include_names)
199 code = self._lib.nvrtcCreateProgram(byref(res),
--> 200 c_char_p(encode_str(src)), c_char_p(encode_str(name)),
201 len(headers),
202 headers_array, include_names_array)
/opt/conda/lib/python3.6/site-packages/pynvrtc/interface.py in encode_str(s)
52 if is_python2:
53 return s
---> 54 return s.encode("utf-8")
55
56
AttributeError: 'bytes' object has no attribute 'encode'
I am installing the latest master of qrnn via python setup.py install
and my pynvrtc
version is 9.2
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:07:31)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import pynvrtc
In [2]: pynvrtc.__version__
Out[2]: '9.2'
Hey @delip , I got it working by also removing kernel.encode in line 102.
Yeah I removed both .encode()
in line 102, though no clue the consequence of the removal.
AttributeError Traceback (most recent call last)