Open cyrilzakka opened 4 years ago
What is your custom data format? jpeg images or array files?
@skyflynil (1024, 1024, 3) JPEG images in a folder
I assume you created the tfrecord using: !python dataset_tool.py create_from_images_raw --res_log2=8 ./dataset/dataset_name untared_raw_image_dir and added --min-h=4 --min-w=4 --res-log2=8 parameters for run_training.py?
I didn't add the extra arguments. I left them as defaults:
!python dataset_tool.py create_from_images_raw dataset/blows blows
since I also used the defaults for !python run_training.py
. Should I add them and try again?
The default for run_training.py is to train 512*512 (min-h=4, min-w=4, res-log2=7) images, but the error does not seems to be related though. Usually there will be shape not equal issue when feeding the image during actual training. The error you got seems to complain the tfrecord itself which I don't quite understand. And you are using tensorflow 1.15.0 right?
Yes 😔 I've also noticed another user with the issue in a fork of your repo: https://github.com/pbaylies/stylegan2/issues/2#issuecomment-586640167
Yes 😔 I've also noticed another user with the issue in a fork of your repo: pbaylies#2 (comment)
It seems to me the issue there was: The record is created using "create_from_images_images" , and training is by default using decoded format ( probably pbaylies changed the default behavior)
The fixed mentioned there is basically matching the reading part to the creation stage.
There's the second part of that issue mentioned by user @pender which seems to have the exact same stack trace as I do.
Also, what is the difference betweencreate_from_images_raw
and create_from_images
? If create_from_images_raw
also expects a directory of images, what are the benefits of using create_from_images_raw
? I get that it reads the images as bytes, but should I use create_from_images
to see if that helps with the problem?
create_from_images_raw directly puts jpeg/png images into tfrecord without decoding while create_from_images first decode the image into numpy arrays then put into the tfrecord. The tradeoff is create_from_images_raw reduce the record size while during training have to pay the penalty of decoding the images again and again. For my repo, the default behavior is training using tfrecord from create_from_images_raw, while for pbaylies's, assuming create_from_images
I've discovered that the error only happens when usingcreate_from_images_raw
and not create_from_images
. Will investigate further after my exams on Monday.
Is there also a way of changing the output of styleGAN? I'm currently getting the following error when running run_training.y
ValueError: Dimension 2 in both shapes must be equal, but are 1024 and 64. Shapes are [?,3,1024,1024] and [?,3,64,64].
I know you said default image size is 512, even after resizing all my images to 512*512, I still get the error with unequal dimensions of 512 and 64. What am I doing wrong? Is there any way of changing the GAN input/output to 1024?
Trying to use
run_training.py
as so:!python run_training.py --num-gpus=1 --data-dir=dataset --config=config-f --dataset=blows --mirror-augment=false --metric=none --total-kimg=20000 --result-dir="/content/drive/My Drive/stylegan2/results"
gives me the following error:yet running the following returns no errors: