RoyWheels / stylegan2-ada

StyleGAN2 with adaptive discriminator augmentation (ADA) - Official TensorFlow implementation
https://arxiv.org/abs/2006.06676
Other
76 stars 13 forks source link

Assertion Error when attempting to create dataset #7

Open jcklpe opened 3 years ago

jcklpe commented 3 years ago

Apologies. I'm an artist/designer with an interest in neural network art, and I'm not really a full developer and I'm having trouble getting the dataset tool to work. 

I made a google colab notebook here:

I am having trouble at this step when I run this command:

!python {styleGAN}/dataset_tool.py create_from_images_raw {telos} {rawImages}

and I get the following result:

Loading images from "///content/gdrive/MyDrive/myfirstGAN/bugz/raw-images"
detected 8 images ...
Shuffle the images...
Creating dataset "bugz"
Added 0 images.
Traceback (most recent call last):
  File "/content/stylegan/dataset_tool.py", line 1116, in <module>
    execute_cmdline(sys.argv)
  File "/content/stylegan/dataset_tool.py", line 1111, in execute_cmdline
    func(**vars(args))
  File "/content/stylegan/dataset_tool.py", line 765, in create_from_images_raw
    tfr.create_tfr_writer(img.shape)
  File "/content/stylegan/dataset_tool.py", line 100, in create_tfr_writer
    assert self.shape[1] % (2 ** self.res_log2) == 0
AssertionError

All my images are 1024x1024 which seems like that means they should work. When I run the command against a sample dataset that was provided in the original colab notebook I forked my project from, it does work though so clearly there's something I'm doing wrong.

I see in the readme there is an update saying that it can not handle non-square images. I will try experimenting with those command options but since I'm running 1024 resolution images just like the sample dataset I don't see why it's giving me this issue.

jcklpe commented 3 years ago

If I go into the dataset_tool.py and comment out the assertion that's giving me problems on line 100, it runs through the dataset process, but then when I run the train command I get the following error:

Traceback (most recent call last):
  File "/content/stylegan/train.py", line 594, in <module>
    main()
  File "/content/stylegan/train.py", line 586, in main
    run_training(**vars(args))
  File "/content/stylegan/train.py", line 439, in run_training
    run_desc, training_options = setup_training_options(**hyperparam_options)
  File "/content/stylegan/train.py", line 115, in setup_training_options
    dataset_obj = dataset.load_dataset(**args.train_dataset_args) # try to load the data and see what comes out
  File "/content/stylegan/training/dataset.py", line 303, in load_dataset
    mirror_augment=mirror_augment, repeat=repeat, shuffle=shuffle)
  File "/content/stylegan/training/dataset.py", line 124, in __init__
    assert len(tfr_files) >= 1
AssertionError
schlonja commented 2 years ago

same issues

jcklpe commented 2 years ago

@Anonymud

I found that a different Colab notebook worked once it ran a check for a sufficiently big enough graphics card to handle the training.