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

'tensorflow' has no attribute 'set_random_seed #205

Open
r1cummings opened this issue Apr 30, 2022 · 2 comments
Open

'tensorflow' has no attribute 'set_random_seed #205

r1cummings opened this issue Apr 30, 2022 · 2 comments

Comments

@r1cummings
Copy link

Hello all, I am trying to run my code and I am getting this error: I tried to modify it based on this stackoverflow post (https://stackoverflow.com/questions/59622277/attributeerror-module-object-has-no-attribute-set-random-seed-when-i) but it is still not working. Does anyone have a fix for this?

AttributeError: module 'tensorflow' has no attribute 'set_random_seed(a.seed)'

@jose-volair
Copy link

Replace 'import tensorflow as tf' with 'import tensorflow.compat.v1 as tf' and add 'tf.disable_v2_behavior()' at the start of main()

@Minhvd19
Copy link

Replace 'import tensorflow as tf' with 'import tensorflow.compat.v1 as tf' and add 'tf.disable_v2_behavior()' at the start of main()

I solved it. Thank you so much!

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