affinelayer / pix2pix-tensorflow

Tensorflow port of Image-to-Image Translation with Conditional Adversarial Nets https://phillipi.github.io/pix2pix/
MIT License
5.07k stars 1.3k forks source link

module 'tensorflow._api.v2.train' has no attribute 'AdamOptimizer' #192

Open VijayaMalla opened 4 years ago

VijayaMalla commented 4 years ago

I am trying to run pix2pix.py and I got an error at line 540, OLD : #tf.set_random_seed(a.seed) NEW : tf.random.set_seed(a.seed)

after that when I run the command again, I am getting this error Traceback (most recent call last): File "pix2pix.py", line 805, in main() File "pix2pix.py", line 627, in main examples = load_examples() File "pix2pix.py", line 259, in load_examples path_queue = tf.train.string_input_producer(input_paths, shuffle=a.mode == "train") AttributeError: module 'tensorflow._api.v2.train' has no attribute 'string_input_producer'

I didn't make any changes, just following the steps at this pix2pix. Please HELP.

Zoe861122 commented 3 years ago

maybe you can add this:

import tensorflow.compat.v1 as tf tf.disable_v2_behavior()

and at line 540 still use OLD : #tf.set_random_seed(a.seed)