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

example_gan.py TypeError #27

Closed
MaevaLC opened this issue Jun 7, 2017 · 2 comments
Closed

example_gan.py TypeError #27

MaevaLC opened this issue Jun 7, 2017 · 2 comments

Comments

@MaevaLC
Copy link

MaevaLC commented Jun 7, 2017

Hello,

Sorry to bother, I'm fairly new to Keras and everything. I'm trying to set up two adversarial neural networks, and your lib seems very interesting to me. I cloned the repository and installation went successfully. But I tried to launch example_gan.py, and I got an error. I don't understand enough yet to be able to solve it by myself...

I'm using Spyder 2.3.9, with Python 3.5, TensorFlow : 1.1.0, Keras : 2.0.4

The error is : "TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64"

PasteBin of the full Traceback : https://pastebin.com/0BaAcuQa

Any kind of help is appreciated :) !

@bstriner
Copy link
Owner

bstriner commented Jun 7, 2017

Issue with python 3. division is an int in python 2 but float in python 3. Dense(hidden_dim/2) should be Dense(int(hidden_dim/2)). Just add an int cast to the line that is failing.

See PR #23

example_gan is fixed but the other examples probably have the same problem.

Cheers

@MaevaLC
Copy link
Author

MaevaLC commented Jun 8, 2017

Thank you very much for fixing this !
I'm sorry to have not seen the PR related...

A tiny thing I changed myself, you might want to know about this :
line 110 : example_gan(AdversarialOptimizerSimultaneous(), "output/gan"),
I just changed "output/gan" to os.path.join("output", "gan"), since on Windows it was a problem.
I know it's not really important, I just wanted to help.

Anyway, thank you for all this work !

@MaevaLC MaevaLC closed this as completed Jun 8, 2017
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