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

Unable to run any Example on Ubuntu #30

Open
attaullah opened this issue Oct 8, 2017 · 1 comment
Open

Unable to run any Example on Ubuntu #30

attaullah opened this issue Oct 8, 2017 · 1 comment

Comments

@attaullah
Copy link

attaullah commented Oct 8, 2017

I am unable to run any of the examples on Ubuntu. Here is the error:
INFO:main.model: f1: convv, leakyrelu, BN, noise 0.00, params [96, 3, 1, 1], dim (3, 32, 32) -> (96, 30, 30)
Traceback (most recent call last):
File "./run.py", line 652, in
if train(d) is None:
File "./run.py", line 411, in train
ladder = setup_model(p)
File "./run.py", line 182, in setup_model
ladder.apply(x, y, x_only)
File "/home/attaullah/Downloads/dlbook_exercises-master/ladder.py", line 197, in apply
clean = self.act.clean = encoder(input_concat, 'clean')
File "/home/attaullah/Downloads/dlbook_exercises-master/ladder.py", line 185, in encoder
noise_std=noise)
File "/home/attaullah/Downloads/dlbook_exercises-master/ladder.py", line 350, in f
z, output_size = self.f_conv(h, spec, in_dim, gen_id('W'))
File "/home/attaullah/Downloads/dlbook_exercises-master/ladder.py", line 451, in f_conv
filter_size), border_mode=bm)
File "/home/attaullah/.local/lib/python2.7/site-packages/theano/tensor/nnet/conv.py", line 153, in conv2d
return op(input, filters)
File "/home/attaullah/.local/lib/python2.7/site-packages/theano/gof/op.py", line 615, in call
node = self.make_node(*inputs, **kwargs)
File "/home/attaullah/.local/lib/python2.7/site-packages/theano/tensor/nnet/conv.py", line 655, in make_node
"inputs(%s), kerns(%s)" % (_inputs.dtype, _kerns.dtype))
NotImplementedError: The image and the kernel must have the same type.inputs(float64), kerns(float32)

I have already set data_path in ".fuelrc" and downloaded data but no luck. I using Ubuntu 17.04, 64 bit python 2.7 and all required python packages with CPU ONLY system. any help in this regard will be much appreciated.

also on some examples:
INFO:main.model:Decoder: z_corr -> z_est
Traceback (most recent call last):
File "run.py", line 652, in
if train(d) is None:
File "run.py", line 411, in train
ladder = setup_model(p)
File "run.py", line 182, in setup_model
ladder.apply(x, y, x_only)
File "/home/attaullah/Downloads/dlbook_exercises-master/ladder.py", line 231, in apply
top_g=top_g)
File "/home/attaullah/Downloads/dlbook_exercises-master/ladder.py", line 576, in g
a1 = bi(0., 'a1')
File "/home/attaullah/Downloads/dlbook_exercises-master/ladder.py", line 499, in
bi = lambda inits, name: self.bias(inits * np.ones(num_filters),
File "/home/attaullah/.local/lib/python2.7/site-packages/numpy/core/numeric.py", line 192, in ones
a = empty(shape, dtype, order)
TypeError: 'numpy.float64' object cannot be interpreted as an index

@attaullah attaullah changed the title Unable to run any on Ubuntu Unable to run any Example on Ubuntu Oct 8, 2017
@ed353
Copy link

ed353 commented Aug 13, 2018

If you read the stack trace, you can see that num_filters is passed into the call to np.ones as a float. If you change the dtype to int, it will work.

I did this by changing lines 464-465 in ladder.py to:

in_dim = np.prod(dtype=np.int64, a=in_dims)
out_dim = np.prod(dtype=np.int64, a=out_dims)

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