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

Training model for Japanese Text facing this issue, please help #6

Open
Zepharchit opened this issue Feb 25, 2020 · 2 comments
Open

Comments

@Zepharchit
Copy link

Traceback (most recent call last):
File "train.py", line 96, in
training_model.fit_generator(train_generator, steps_per_epoch=int(train_generator.nb_samples / train_generator.batch_size), epochs=cfg.nb_epochs, verbose=1, workers=cfg.nb_workers, use_multiprocessing=True, callbacks=callbacks)
File "/home/eleven/ocr_keras/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/home/eleven/ocr_keras/lib/python3.6/site-packages/keras/engine/training.py", line 1732, in fit_generator
initial_epoch=initial_epoch)
File "/home/eleven/ocr_keras/lib/python3.6/site-packages/keras/engine/training_generator.py", line 100, in fit_generator
callbacks.set_model(callback_model)
File "/home/eleven/ocr_keras/lib/python3.6/site-packages/keras/callbacks/callbacks.py", line 68, in set_model
callback.set_model(model)
File "/home/eleven/ocr_keras/lib/python3.6/site-packages/keras/callbacks/tensorboard_v2.py", line 116, in set_model
super(TensorBoard, self).set_model(model)
File "/home/eleven/ocr_keras/lib/python3.6/site-packages/tensorflow_core/python/keras/callbacks.py", line 1532, in set_model
self.log_dir, self.model._get_distribution_strategy()) # pylint: disable=protected-access
AttributeError: 'Model' object has no attribute '_get_distribution_strategy'

@janzd
Copy link
Owner

janzd commented Mar 23, 2020

It seems to be a compatibility issue between TF and Keras. Are you using TF v2? I only used this code in TF v1 so it doesn't include any features that are only in TF v2. You can either try it in TF v1 or if you want to use TF v2, you could try to change keras imports so that it imports tensorflow.keras instead. I found this issue with the same error message. googlecolab/colabtools#925

@subhadeepkaran
Copy link

subhadeepkaran commented May 26, 2020

@Zepharchit by now you might have resolved possibly.
but you may give it a try
https://github.com/googlecolab/colabtools/issues/925#issuecomment-633889012

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

3 participants