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

a float is required , : lm_rnn.py #5

Open
byeongcheoljo opened this issue Jan 9, 2017 · 3 comments
Open

a float is required , : lm_rnn.py #5

byeongcheoljo opened this issue Jan 9, 2017 · 3 comments

Comments

@byeongcheoljo
Copy link

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

@odashi
Copy link
Owner

odashi commented Jan 9, 2017

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.

@byeongcheoljo
Copy link
Author

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

@odashi
Copy link
Owner

odashi commented Jan 11, 2017

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

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