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

Cannot run cuda with version 8.0 #1

Closed
tzatter opened this issue Sep 21, 2016 · 2 comments
Closed

Cannot run cuda with version 8.0 #1

tzatter opened this issue Sep 21, 2016 · 2 comments

Comments

@tzatter
Copy link

tzatter commented Sep 21, 2016

Ubuntu16.04 GTX960 2G

Traceback (most recent call last):
File "iGAN_main.py", line 38, in
model_G = model_class.Model(model_name=args.model_name, model_file=args.model_file)
File "/home/tzatter/iGAN/model_def/dcgan_theano.py", line 24, in init
self._gen = self.def_gen(self.gen_params, self.gen_pl, self.n_layers, self.n_f)
File "/home/tzatter/iGAN/model_def/dcgan_theano.py", line 34, in def_gen
gx = gen_test(z, gen_params, gen_pl, n_layers=n_layers, n_f=n_f)
File "/home/tzatter/iGAN/model_def/dcgan_theano.py", line 319, in gen_test
hout = relu(batchnorm(deconv(hin, w, subsample=(2, 2), border_mode=(2, 2)), u=u, s=s, g=g, b=b))
File "/home/tzatter/iGAN/lib/ops.py", line 90, in deconv
img = gpu_contiguous(X)
File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 602, in call
node = self.make_node(_inputs, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/basic_ops.py", line 3963, in make_node
input = as_cuda_ndarray_variable(input)
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/basic_ops.py", line 46, in as_cuda_ndarray_variable
return gpu_from_host(tensor_x)
File "/usr/local/lib/python2.7/dist-packages/theano/gof/op.py", line 602, in call
node = self.make_node(_inputs, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/basic_ops.py", line 139, in make_node
dtype=x.dtype)()])
File "/usr/local/lib/python2.7/dist-packages/theano/sandbox/cuda/type.py", line 95, in init
(self.class.name, dtype, name))
TypeError: CudaNdarrayType only supports dtype float32 for now. Tried using dtype float64 for variable None

Jun-Yan Zhu, thank you for the awesome code.

@tzatter
Copy link
Author

tzatter commented Sep 21, 2016

A problem is solved by adding this parameter
$ THEANO_FLAGS='floatX=float32' python iGAN_main.py

@tzatter tzatter closed this as completed Sep 21, 2016
@junyanz
Copy link
Owner

junyanz commented Sep 21, 2016

Yes, you have to use Theano flags like:

THEANO_FLAGS='device=gpu0, floatX=float32, nvcc.fastmath=True' python ...

If you are familiar with Theano, you can also add config.lib.cnmem=0.8 to slightly boost the fps. More information on Theano flags can be found here

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