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

error on training #4

Open
dbswnsdud123 opened this issue Oct 12, 2019 · 3 comments
Open

error on training #4

dbswnsdud123 opened this issue Oct 12, 2019 · 3 comments

Comments

@dbswnsdud123
Copy link

i'm using a google colab.
when i start !python train_val.py

Traceback (most recent call last):
File "train_val.py", line 86, in
verbose=1)
File "/usr/local/lib/python3.6/dist-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 1658, in fit_generator
initial_epoch=initial_epoch)
File "/usr/local/lib/python3.6/dist-packages/keras/engine/training_generator.py", line 103, in fit_generator
callbacks._call_begin_hook('train')
File "/usr/local/lib/python3.6/dist-packages/keras/callbacks.py", line 103, in _call_begin_hook
self.on_train_begin()
File "/usr/local/lib/python3.6/dist-packages/keras/callbacks.py", line 219, in on_train_begin
callback.on_train_begin(logs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/callbacks.py", line 905, in on_train_begin
if self.model._in_multi_worker_mode():
AttributeError: 'Model' object has no attribute '_in_multi_worker_mode'

@dabasajay
Copy link
Owner

dabasajay commented Nov 22, 2019

Please make sure that you're using the right version of libraries as mentioned in the requirements section in Readme.md
I think this error is due to version mismatch as Keras & Tensorflow API is constantly changing and my code was tested on Tensorflow - 1.13.1 & Keras - 2.2.4.
P.S. I also used Google Colab for the project so there shouldn't be an issue provided that you have the right version of libraries.

@hggit
Copy link

hggit commented Jul 1, 2020

This error arises due to the mixed usage of Keras API and tensorflow.keras API. I was able to resolve the error by changing
from tensorflow.keras.callbacks import ModelCheckpoint
to
from keras.callbacks import ModelCheckpoint
in the train_val.py file.

@dipendrachouhan007
Copy link

This error arises due to the mixed usage of Keras API and tensorflow.keras API. I was able to resolve the error by changing from tensorflow.keras.callbacks import ModelCheckpoint to from keras.callbacks import ModelCheckpoint in the train_val.py file.

In my code I used only keras. rather than tensorflow.keras. then also I am getting error:

tensorflow.python.framework.errors_impl.invalidargumenterror graph execution error

what should I do please tell me

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

4 participants