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.

ValueError on train with celebA

See original GitHub issue

I’m getting an error during training. I tried it both with a version of celebA I already had on hand and with the one output by and I got the same error. I’m running the system with --use_gpu=False (in case that matters).

Thanks for your help!

Here’s the output and stack trace:

`[*] MODEL dir: logs/celebA_0418_104602 [*] PARAM path: logs/celebA_0418_104602/params.json 0%| | 0/500000 [00:00<?, ?it/s][0/500000] Loss_D: 0.538686 Loss_G: 0.048095 measure: 0.7599, k_t: 0.0002 [*] Samples saved: logs/celebA_0418_104602/0_G.png

Traceback (most recent call last): File “”, line 43, in <module> main(config) File “”, line 35, in main trainer.train() File “/home/mvertolli/BEGAN/”, line 158, in train self.autoencode(x_fixed, self.model_dir, idx=step, x_fake=x_fake) File “/home/mvertolli/BEGAN/”, line 263, in autoencode x =, {self.x: img}) File “/home/mvertolli/virtualenvs/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/”, line 778, in run run_metadata_ptr) File “/home/mvertolli/virtualenvs/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/client/”, line 961, in _run % (np_val.shape,, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (16, 3, 64, 64) for Tensor u’ToFloat:0’, which has shape ‘(16, 64, 64, 3)’`

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

carpedm20commented, Apr 19, 2017

@mrjel It’s because of the performance. ‘NCHW’ is cuDNN default which can make the GPU calculation faster. Details can be found

@MichaelOVertolli I didn’t tested for --use_gpu=False and that’s why the error causes. I can fix that problem but I can pretty sure that you can’t achieve whatever you want without gpu. You need GPU to train BEGAN in reasonable timeline (in hours or 1~2 days) or you’ll need to wait weeks unless you’re not training small dataset like MNIST. CelebA won’t be trained without GPU in reasonable time.

zhangqianhuicommented, Jun 29, 2017

@carpedm20 thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Who can help me slove this error? (when I try to train ) #175
checkpoints/celebA Training epoch: 1 loading error: datasets/celebA/train/000195.jpg ... ValueError: empty range for randrange() (0,0, 0).
Read more >
DCGAN: ValueError: Input 0 of layer deconv is incompatible ...
I missed the step to preprocess the CelebA dataset images. ... def train(args): tf.reset_default_graph() data_loader ...
Read more >
Error in Training and Testing - data - PyTorch Forums
Hi, I've been trying to make a custom dataset, a training, and a testing ... train = FaceLandmarksDataset(csv_file='/content/gdrive/MyDrive/celeba-mini/ ...
Read more >
datasets/ · edgify/torchvision - Gemfury
Args: root (string): Root directory where images are downloaded to. split (string): One of {'train', 'valid', 'test', 'all'}.
Read more >
Data cardinality is ambiguous: ` after running `` - Reddit
I am experiencing an error related to my data after running the error is: ValueError: Data cardinality is ambiguous: x sizes: ...
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 Post

No results found

github_iconTop Related Hashnode Post

No results found