universome / stylegan-v

[CVPR 2022] StyleGAN-V: A Continuous Video Generator with the Price, Image Quality and Perks of StyleGAN2
https://universome.github.io/stylegan-v
333 stars 36 forks source link

Error: batch_size should be a positive integer value, but got batch_size=0 #40

Open lweingart opened 6 months ago

lweingart commented 6 months ago

Hello guys,

Thank you very much for your work. I'm trying to train my model based on my own dataset, but when running the training command it always fails with the following error:

File "/home/ubuntu/git/stylegan-v/env-ampere/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 215, in __init__
    raise ValueError("batch_size should be a positive integer value, "
ValueError: batch_size should be a positive integer value, but got batch_size=0

Even if I try to specify the batch size in the command by adding training.batch_size=8 for instance, it keeps failing with the same error message.

The command I use is:

python src/infra/launch.py hydra.run.dir=test_rundir exp_suffix=test_exp env=raven-local dataset=ffs dataset.resolution=512 num_gpus=2 training.batch_size=8

Would someone have any idea what I should do to get around this please? Thank you very much for your help in advance.

Cheers

lweingart commented 6 months ago

High again,

So, I realised that I have this issue when I use my dataset with a 512 resolution. If I use the exact same dataset but with a resolution of 256, it works. It makes no sense to me. I printed out the value of batch_size in the sampler.py file and the value is changing at each training iteration. For some reason it works at a resolution of 256, but when the resolution is at 512, the batch_size turns to 0. I'm specifying the training.batch_size value when running the training command, and it is correctly written in the experiment_confog.yaml file.

I'm at a complete loss as to how I could train my model with a dataset at a 512 resolution. Would anyone have any idea please ?

Cheers