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

error while training #46

Closed
Seairis7 opened this issue Nov 14, 2019 · 2 comments
Closed

error while training #46

Seairis7 opened this issue Nov 14, 2019 · 2 comments

Comments

@Seairis7
Copy link

Traceback (most recent call last):
File "train.py", line 29, in
main()
File "train.py", line 26, in main
trainer.train()
File "/content/new/gan/train.py", line 103, in train
self.save_generated_images()
File "/content/new/gan/train.py", line 44, in save_generated_images
image = self.dataset.display(self.generator.predict_on_batch(batch), batch)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 1274, in predict_on_batch
outputs = self.predict_function(ins)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2715, in call
return self._call(inputs)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2671, in _call
session)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2623, in _make_callable
callable_fn = session._make_callable_from_options(callable_opts)
File "/usr/local/lib/python2.7/dist-packages/tensorflow_core/python/client/session.py", line 1505, in _make_callable_from_options
return BaseSession._Callable(self, callable_options)
File "/usr/local/lib/python2.7/dist-packages/tensorflow_core/python/client/session.py", line 1460, in init
session._session, options_ptr)
tensorflow.python.framework.errors_impl.InvalidArgumentError: input_1:0 is both fed and fetched.

@AliaksandrSiarohin
Copy link
Owner

You are using wrong tensorflow version, see #15

@Seairis7
Copy link
Author

Seairis7 commented Nov 15, 2019

@AliaksandrSiarohin
When I run your code in my cpu it work fine and now
I am trying to run it in google colab and it throw another error :

Traceback (most recent call last):
File "train.py", line 29, in
main()
File "train.py", line 12, in main
args.use_bg, args.pose_rep_type)
File "/new/conditional_gan.py", line 143, in make_generator
outputs = [keras.layers.Lambda(lambda x: ktf.identity(x))(out) for out in outputs]
NameError: global name 'keras' is not defined

I added 'import keras' at conditional_gan.py and run it again it gives new error:

Traceback (most recent call last):
File "train.py", line 29, in
main()
File "train.py", line 23, in main
gan = CGAN(generator, discriminator, **vars(args))
File "/new/conditional_gan.py", line 262, in init
discriminator_optimizer=Adam(2e-4, 0.5, 0.999), **kwargs)
File "/new/gan/gan.py", line 29, in init
generator_input = self._generator.input
AttributeError: 'NoneType' object has no attribute 'input'

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

2 participants