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

AttributeError: 'Model' object has no attribute '_get_distribution_strategy' #1239

Closed
milansoliya4210 opened this issue Dec 24, 2019 · 17 comments

Comments

@milansoliya4210
Copy link

I am trying to train model in Google Colab using tensorflow 2.x bundle package for Colab and Getting Error as mention Below:

AttributeError:'Model' object has no attribute _get_distribution_strategy'

@hgaiser
Copy link
Contributor

hgaiser commented Jan 6, 2020

tensorflow/tensorflow#34870

you can also remove the tensorboard callback for now.

@shadow12138
Copy link

tensorflow/tensorflow#34870

you can also remove the tensorboard callback for now.

Will the training weights be saved if the callback is removed?

@hgaiser
Copy link
Contributor

hgaiser commented Jan 21, 2020

Yes they will be. Only thing you lose is the usage of Tensorboard.

ps. you can also use --tensorboard-dir "" on the command line to disable Tensorboard callback.

@SalahAdDin
Copy link
Contributor

It is a problem with keras, right? I mean, you cannot solve it in this implementation, right?

@shadow12138
Copy link

It is a problem with keras, right? I mean, you cannot solve it in this implementation, right?

i solved it by --tensorboard-dir ""

@SaltyGlutinousRiceBall
Copy link

SaltyGlutinousRiceBall commented Feb 25, 2020

Yes they will be. Only thing you lose is the usage of Tensorboard.

ps. you can also use --tensorboard-dir "" on the command line to disable Tensorboard callback.

'--tensorboard-dir ""' is not an internal or external command, nor is it a runnable program or batch files.@hgaiser

@hgaiser
Copy link
Contributor

hgaiser commented Feb 27, 2020

It is a problem with keras, right? I mean, you cannot solve it in this implementation, right?

It's a problem with keras and tensorflow. Tensorflow made some changes that didn't work when using keras, only works when using tensorflow.keras. tensorflow/tensorflow#34870 got merged so this should be automatically fixed with a new tensorflow release.

@stale
Copy link

stale bot commented Apr 27, 2020

This issue has been automatically marked as stale due to the lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issues with no activity for a long time label Apr 27, 2020
@daryl-user
Copy link

daryl-user commented Apr 29, 2020

Did you try import from tensorflow.keras instead of directly from keras?

@stale stale bot removed the stale Issues with no activity for a long time label Apr 29, 2020
@ZhangYuef
Copy link

Did you try import from tensorflow.keras instead of directly from keras?

It's the same for me. Both tensorflow.keras and keras raise the error.

@hgaiser
Copy link
Contributor

hgaiser commented May 7, 2020

Tensorflow just released version 2.2, this should fix this issue.

@hgaiser hgaiser closed this as completed May 7, 2020
@DarthAmk97
Copy link

The issue persists :(

@SalahAdDin
Copy link
Contributor

@DarthAmk97 Use the monkeypatch solution ,it works for me.

@TimNagle-McNaughton
Copy link

@SalahAdDin can you provide a link to or any documentation of that solution?

@SalahAdDin
Copy link
Contributor

It is a problem with keras, right? I mean, you cannot solve it in this implementation, right?

i solved it by --tensorboard-dir ""

@TimNagle-McNaughton This one.

@TimNagle-McNaughton
Copy link

oh. Sadly that doesn't actually fix the functionality, just removes the functionality and the error. Thanks

@SalahAdDin
Copy link
Contributor

@TimNagle-McNaughton it is related to Tensorflow library more than this package, unfortunately.

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

9 participants