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

ValueError: Cannot feed value of shape (64, 218, 178, 3) for Tensor 'real_images:0', which has shape '(64, 64, 64, 3)' #373

Open
kazad123 opened this issue Jan 17, 2020 · 2 comments

Comments

@kazad123
Copy link

kazad123 commented Jan 17, 2020

I am getting the following error when trying to train the model using the celebA dataset. Load fails to find a checkpoint, which makes sense since there are no checkpoints. Then the following error occurs. I have pasted some of the last output along with the stacktrace. I would appreciate any and all help

  Total size of variables: 9451908
    Total bytes of variables: 37807632
     [*] Reading checkpoints... ./out\20200116.161511 - data - celebA -x108.z100.uniform_signed.y64.b64\checkpoint
     [*] Failed to find a checkpoint
     [!] Load failed...
Traceback (most recent call last):
  File "main.py", line 147, in <module>
    tf.app.run()
  File "C:\Users\...\.conda\envs\py3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
    _sys.exit(main(argv))
  File "main.py", line 120, in main
    dcgan.train(FLAGS)
  File "C:\Users\...\Documents\DCGAN-tensorflow-master\model.py", line 279, in train
    feed_dict={ self.inputs: batch_images, self.z: batch_z })
  File "C:\Users\...\.conda\envs\py3\lib\site-packages\tensorflow\python\client\session.py", line 929, in run
    run_metadata_ptr)
  File "C:\Users\...\.conda\envs\py3\lib\site-packages\tensorflow\python\client\session.py", line 1128, in _run
    str(subfeed_t.get_shape())))
ValueError: Cannot feed value of shape (64, 218, 178, 3) for Tensor 'real_images:0', which has shape '(64, 64, 64, 3)'

Thank you

@rajendrac3
Copy link

To resolve this:

add img_bgr = cv2.resize(img_bgr, (200, 200)) in utils.py after img_bgr = cv2.imread(path)

@aseem-thakkar
Copy link

@rajendrac3

I added
img_bgr = cv2.resize(img_bgr, (64, 64)) instead of
img_bgr = cv2.resize(img_bgr, (200, 200))

And it worked for me

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