question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python3 runGan.py 1: AttributeError: module 'tensorflow' has no attribute 'set_random_seed'

See original GitHub issue

macOS 10.15.6 (tensorflow, not tensorflow-gpu: tensorflow-2.3.0-cp38-cp38-macosx_10_11_x86_64.whl).

$ python3 runGan.py 1
Testing test case 1
Traceback (most recent call last):
  File "main.py", line 19, in <module>
    tf.set_random_seed(1234)
AttributeError: module 'tensorflow' has no attribute 'set_random_seed'

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:13

github_iconTop GitHub Comments

7reactions
ayush9198guptacommented, Aug 27, 2020

Hi,

I have solved all the errors , just use TensorFlow 1.8.0 and Keras 2.1.5 version and do not change the tf.random.set_seed(1234) use tf.set_random_seed(1234)

it was working in my case.

Thanks.

1reaction
xxRockOnxxcommented, Sep 30, 2020

For anyone who stumbled upon here from google or just by the issues:

Python 3.6 is the last version Tensorflow 1.8 supports so I installed that. I also needed to manually install Keras 2.1.5 like @ayush9198gupta said.

After that it’s working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

module 'tensorflow' has no attribute 'set_random_seed' · Issue ...
tf2.0 tf.set_random_seed(self._seed) AttributeError: module 'tensorflow' has no attribute 'set_random_seed'
Read more >
Ask Question - Stack Overflow
I checked out this (AttributeError: 'module' object has no attribute 'set_random_seed') question on stackoverflow but it doesn't really apply to ...
Read more >
module 'tensorflow' has no attribute 'set_random_seed'
attributeerror : module 'tensorflow' has no attribute 'set_random_seed' site:stackoverflow.com. Add Answer | View In TPC Matrix.
Read more >
python3 runGan.py 1: AttributeError: module 'tensorflow' has ...
Eh, I tried pip install -Iv tensorflow==1.8.0 and that just generated a lot of output and then failed with ERROR: Could not find...
Read more >
module 'tensorflow.random' has no attribute 'set_seed' code ...
Example 1: module 'tensorflow' has no attribute 'set_random_seed' tf.random.set_seed(seed) Example 2: AttributeError: module 'tensorflow' has no attribute ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found