skyflynil / stylegan2

StyleGAN2 - Official TensorFlow Implementation with practical improvements
http://arxiv.org/abs/1912.04958
Other
120 stars 33 forks source link

1280x768 error #3

Closed dvschultz closed 4 years ago

dvschultz commented 4 years ago

first off, thanks for making this. I’m really excited to see if I can get hi-res non-squares working.

I have a set of 1280x768 images (10x6,n=7) but get the following error when trying to train.

(0) Invalid argument: Cannot batch tensors with different shapes in component 0. First element had shape [3,1280,685] and element 1 had shape [3,1280,768].
     [[node GPU0/DataFetch/IteratorGetNext (defined at /root/stylegan2/training/dataset.py:193) ]]
     [[GPU0/DataFetch/IteratorGetNext/_4117]]
  (1) Invalid argument: Cannot batch tensors with different shapes in component 0. First element had shape [3,1280,685] and element 1 had shape [3,1280,768].

I’ve double-checked and all images seem to be 1280x768. Any other thoughts on what could be going on here?

full log attached log.txt

skyflynil commented 4 years ago

with 1280*768, I actually got an GPU out of memory error (colab P100 with 16G) with (10x6,n=7) setup. If changed to (5X3, n =8,) the training runs fine.

I guess first to make sure all the raw images are with the same size as 1280*768. And to work around the GPU memory issue, change code for the mini batch setup or just use min-h=5 min-w=3, res-log2=8 as the input.

dvschultz commented 4 years ago

Thanks, thats really helpful to know (I’m on a 24GB GPU so its not an issue, but good to know should I switch to a 16GB).

and of course I did find one image with bad sizing.