Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow set_seed error when running autoencoder

Tags:

tensorflow

I am trying to run the code from here, https://medium.com/@abien.agarap/implementing-an-autoencoder-in-tensorflow-2-0-5e86126e9f7

but am getting this error,

File "C:/Users/rupert/Versioning/PCTSoftware/Libraries/python/tensorflow/autoencoders/autoencoder-full.py", line 12, in tf.random.set_seed(1)

AttributeError: module 'tensorflow._api.v1.random' has no attribute 'set_seed'

Any ideas on how to resolve?

Tensorflow 1.13 Windows 7

like image 431
PerceptualRobotics Avatar asked May 04 '19 12:05

PerceptualRobotics


2 Answers

Try this:

tf.random.set_random_seed(1)
like image 53
John Avatar answered Nov 06 '22 00:11

John


As you can see, the post is focusing on the version 2.0.0 of tensorflow. You should run their code with their version.

like image 2
Zaccharie Ramzi Avatar answered Nov 06 '22 02:11

Zaccharie Ramzi