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

Keras Issue #35

Open
vgcapizzi opened this issue Feb 7, 2018 · 10 comments
Open

Keras Issue #35

vgcapizzi opened this issue Feb 7, 2018 · 10 comments

Comments

@vgcapizzi
Copy link

I was able to successfully run train.py on my laptop. I went to switch the program to my PC so I could train faster. But when I rebuilt the program I ran into this issue.

Loading training data
Finished loading training data
Starting training!
Iteration: 0
Epoch 0
Traceback (most recent call last):
File "C:\Python27\GRUV-master\train.py", line 48, in
history = model.fit(X_train, y_train, batch_size=batch_size, nb_epoch=epochs
_per_iter, verbose=1, validation_split=0.0)
File "C:\Python27\lib\site-packages\keras\models.py", line 204, in fit
callbacks.on_epoch_end(epoch, epoch_logs)
UnboundLocalError: local variable 'epoch_logs' referenced before assignment

not sure whats happening here. Im using keras 0.1.0, Please help!

@bgroenks96
Copy link

bgroenks96 commented Feb 7, 2018

It very well might be a bug in what was a very early version of Keras. I would highly recommend upgrading.

I've already gone through the pain of doing so for you, actually. I have a branch in my fork that includes only the Keras upgrade and none of my later modifications.

Correction: It does include a few of my modifications, but nothing terribly significant.

@vgcapizzi
Copy link
Author

vgcapizzi commented Feb 7, 2018

Thanks for the help! So what version of keras should I be using?

Cause when I revised those three programs using your code I get this error now.

Traceback (most recent call last):
File "C:\Python27\GRUV-master\train.py", line 5, in
import nn_utils.network_utils as network_utils
File "C:\Python27\GRUV-master\nn_utils\network_utils.py", line 2, in
from keras.layers import TimeDistributed, Dense, LSTM, GRU
ImportError: cannot import name TimeDistributed

I was under the impression that these methods were only used in versions of keras later than 0.1.0. Just let me know what you think of this. Thanks again bgroenks96

@bgroenks96
Copy link

If you use my updated code, you should have the latest version of Keras available from pip installed.

@vgcapizzi
Copy link
Author

When using your code with the latest version of keras installed which is 2.1.3 I get this new error.

usage: train.py [-h] [-e EPOCHS] [-b BATCH] current_iteration num_iterations
train.py: error: too few arguments

Any Ideas?

@bgroenks96
Copy link

One of the other changes I made early on was adding a command line interface. That earlier version requires you to supply the current iteration you want to start on and the number of iterations to perform.

So to run 10 iterations starting at iteration 0: python train.py 0 10

You're free to remove that and just use hardcoded values instead, of course.

@bgroenks96
Copy link

I recommend that you review the total diff between that branch and the original GRUV code to get a better understanding of what changed and what you might want to change yourself.

@vgcapizzi
Copy link
Author

I feel so stupid I didnt realize you provided an interface. The original program had 50 iterations hardcoded in. Ill try that out tonight it may already be working and I was just being dumb.

@vgcapizzi
Copy link
Author

I was able to get a successful run after I added two empty files in the datasets folder. The way your code worked I needed a folder called gen and one called train to properly parse the file paths. Now all I got to do is get theano to use my gpu instead of my cpu and I will be good for another training session. Thanks again.

@bgroenks96
Copy link

I would recommend that you use the TensorFlow backend. I went down the rabbit hole of trying to get Theano to use my GPU, and it never worked. TensorFlow worked pretty much out of the box.

@vgcapizzi
Copy link
Author

Damn I wish I looked at this comment a couple hours ago. I have literally spent this entire time trying to get Theano to work on my GPU to no avail lol. Im going to switch to anaconda using python35 so I can use TensorFlow cause stopped supporting TensorFlow for python27.

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