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

_get_all_files not defined in dataset_tool.py #2

Closed valentinvieriu closed 3 years ago

valentinvieriu commented 3 years ago

I'm trying to run the training with raw images, and it's failing to have a positive outcome. I suspect that _get_all_files is missing from the dataset_tool.py

stylegan2-ada_1  | Traceback (most recent call last):
stylegan2-ada_1  |   File "train.py", line 588, in <module>
stylegan2-ada_1  |     main()
stylegan2-ada_1  |   File "train.py", line 580, in main
stylegan2-ada_1  |     run_training(**vars(args))
stylegan2-ada_1  |   File "train.py", line 434, in run_training
stylegan2-ada_1  |     run_desc, training_options = setup_training_options(**hyperparam_options)
stylegan2-ada_1  |   File "train.py", line 114, in setup_training_options
stylegan2-ada_1  |     dataset_obj = dataset.load_dataset(**args.train_dataset_args) # try to load the data and see what comes out
stylegan2-ada_1  |   File "/app/training/dataset.py", line 303, in load_dataset
stylegan2-ada_1  |     mirror_augment=mirror_augment, repeat=repeat, shuffle=shuffle)
stylegan2-ada_1  |   File "/app/training/dataset.py", line 124, in __init__
stylegan2-ada_1  |     assert len(tfr_files) >= 1
stylegan2-ada_1  | AssertionError
RoyWheels commented 3 years ago

Thanks for bringing this to my attention. I've been using previously created datasets so far and haven't had to use the dataset_tool. I thought I'd changed it correctly but I should have tested it. Sorry about that.

I'll get it working again soon.

RoyWheels commented 3 years ago

Seems to be working again now. I've used the tool to create a raw dataset and managed to start training.

valentinvieriu commented 3 years ago

Thank you that was fast! Will give it a try this evening. I hope I can use the training without creating the tfrecords. I assume that's what this option is.

RoyWheels commented 3 years ago

The datasets created use one tfrecord containing the raw images so it's much smaller than the full version.

Here's the command I use:

!python dataset_tool.py create_from_images_raw --res_log2=7 "/content/datasets/your_dataset_name_raw" "/path_to_your_images"

Remember to use the -res_log2 value you will use in training.

The training is setup to use raw datasets as default so you only need to use --use_raw=0 in your training command if you're not using a raw database.

valentinvieriu commented 3 years ago

Thank you for the clarifications. Now it works, it was not clear that I have to generate the tfrecords. I thought that somehow it uses directly the images.