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

doesn't work out of the box #9

Closed
ikamensh opened this issue Nov 14, 2016 · 2 comments
Closed

doesn't work out of the box #9

ikamensh opened this issue Nov 14, 2016 · 2 comments

Comments

@ikamensh
Copy link

Hello,

I tried to launch this project locally. I set my keras to use theano, python = 2.7; its ubuntu.

Traceback (most recent call last):
File "dcgun.py", line 167, in
train(BATCH_SIZE=args.batch_size)
File "dcgun.py", line 80, in train
discriminator = discriminator_model()
File "dcgun.py", line 46, in discriminator_model
model.add(Dense(1024))
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 312, in add
output_tensor = layer(self.outputs[0])
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 487, in call
self.build(input_shapes[0])
File "/usr/local/lib/python2.7/dist-packages/keras/layers/core.py", line 695, in build
name='{}_W'.format(self.name))
File "/usr/local/lib/python2.7/dist-packages/keras/initializations.py", line 59, in glorot_uniform
return uniform(shape, s, name=name)
File "/usr/local/lib/python2.7/dist-packages/keras/initializations.py", line 32, in uniform
return K.random_uniform_variable(shape, -scale, scale, name=name)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/theano_backend.py", line 140, in random_uniform_variable
return variable(np.random.uniform(low=low, high=high, size=shape),
File "mtrand.pyx", line 1565, in mtrand.RandomState.uniform (numpy/random/mtrand/mtrand.c:17319)
OverflowError: Range exceeds valid bounds

@jacobgil
Copy link
Owner

jacobgil commented Nov 15, 2016

This seems like a potential problem with keras / theano.
Please upgrade both versions and try again.

Also please check the versions of both by:
import tensorflow as tf
print tf.__version__
import keras
print keras.__version__

@ikamensh
Copy link
Author

Actual problem was mismatch between backend and image_dim_ordering; I changed the backend to theano but forgot the image ordering.

A correction to ~/.keras/keras.json solved it:

{
"image_dim_ordering": "th",
"epsilon": 1e-07,
"floatx": "float32",
"backend": "theano"
}

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