chainer_examples icon indicating copy to clipboard operation
chainer_examples copied to clipboard

a float is required , : lm_rnn.py

Open byeongcheoljo opened this issue 8 years ago • 3 comments

Hi, I have some problem. I compile the code that lm_rnn.py

a float is required...

File "lm_rnn.py", line 219, in main() File "lm_rnn.py", line 213, in main save_rnnlm_model(args.model + '.%d' % (epoch + 1), args.vocab, args.embed, args.hidden, vocab, model) File "lm_rnn.py", line 107, in save_rnnlm_model print(dlm.join(fmt % x for x in row), file=fp) File "lm_rnn.py", line 107, in print(dlm.join(fmt % x for x in row), file=fp) TypeError: a float is required

byeongcheoljo avatar Jan 09 '17 09:01 byeongcheoljo

Which version of Chainer are you using? Since many internal architectures of Chainer had been dramatically changed by the ver. 1.5 update, basically all code in the "1.4" directory cannot be run on 1.5 or later versions. These code are kept by only some historical reasons and I never update them in further commits. If you need to use these code, please refer to the official document to know what you need to fix bugs.

odashi avatar Jan 09 '17 15:01 odashi

thank you answer my question. I changed version (1.19 --> 1.4) I have another error..

nvcc fatal : Value 'sm_61' is not defined for option 'gpu-architecture' Traceback (most recent call last): File "lm_rnn.py", line 219, in main() File "lm_rnn.py", line 188, in main opt.zero_grads() File "/usr/local/lib/python3.5/dist-packages/chainer/optimizer.py", line 131, in zero_grads g.fill(0) File "/usr/local/lib/python3.5/dist-packages/cupy/init.py", line 404, in fill elementwise.copy(value, self, dtype=self._dtype) File "/usr/local/lib/python3.5/dist-packages/cupy/elementwise.py", line 673, in call self._params, self.name, self._preamble) File "/usr/local/lib/python3.5/dist-packages/cupy/util.py", line 34, in ret result = f(*args, **kwargs) File "/usr/local/lib/python3.5/dist-packages/cupy/elementwise.py", line 487, in _get_ufunc_kernel kernel_params, operation, name, preamble) File "/usr/local/lib/python3.5/dist-packages/cupy/elementwise.py", line 36, in _get_simple_elementwise_kernel module = carray.compile_with_cache(module_code, options) File "/usr/local/lib/python3.5/dist-packages/cupy/carray.py", line 74, in compile_with_cache return cuda.compile_with_cache(source, options, arch, cachd_dir) File "/usr/local/lib/python3.5/dist-packages/cupy/cuda/compiler.py", line 125, in compile_with_cache cubin = nvcc(source, options, arch) File "/usr/local/lib/python3.5/dist-packages/cupy/cuda/compiler.py", line 50, in nvcc subprocess.check_output(cmd, cwd=root_dir) File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['nvcc', '--cubin', '-arch', 'sm_61', '/tmp/tmp53u5n8ij/kern.cu']' returned non-zero exit status 1

byeongcheoljo avatar Jan 11 '17 07:01 byeongcheoljo

This error probably seems some sort of problems in your environment. Please check the CUDA binaries works correctly.

odashi avatar Jan 11 '17 08:01 odashi