NVlabs/long-video-gan

Dataset resolution question

Closed this issue · 1 comments

Hello,

I was trying your code quickly before engaging in the creation of a strong dataset and putting in place a multiple GPU cloud instance, so I quickly created a short one for testing and understanding your work.
I prepared a dataset with only one resolution.
Then, when running the training code, I get the following error:

 File "train_sres.py", line 403, in main
    train(**c)
  File "train_sres.py", line 98, in train
    dataset = VideoDatasetTwoRes(
  File "<string>", line 13, in __init__
  File "/home/lweingart/git/long-video-gan/dataset.py", line 122, in __post_init__
    self.lr_dataset = VideoDataset(
  File "<string>", line 11, in __init__
  File "/home/lweingart/git/long-video-gan/dataset.py", line 41, in __post_init__
    assert self.dataset_path.is_dir(), self.dataset_path
AssertionError: dataset/0720x1280/0036x0064

as if the VideoDataset was expecting a directory named 0036x0064.
(whatever path I put for the --dataset arg gets the same error result, with 0036x0064 at the end)

In my quick and dirty dataset, the videos are with a high res 720x1280.

So my questions are the following:
Are we supposed to only create datasets of 144x256 and/or 32x64 ?
Also, is it expected that we pass a dataset_path that contains these 2 resolutions, or is it possible to train with only one resolution ?

The command I used to prepare the dataset:

python -m dataset_tools.make_dataset_from_videos dummy-dataset dataset --height=720 --width=1280 --partition=0 --num-partitions=1
Listing video paths: 2it [00:00, 28728.11it/s]
Partition index 0 (1 / 1)
Saving video clips to ZIP file: 100%|██████████████████████████████████| 2/2 [00:02<00:00,  1.15s/it]

This had for result a dataset/0720x1280 directory containing a zip,

Then I ran:

python train_sres.py --outdir=runs/sres --dataset=dataset/0720x1280 --batch=1 --grad-accum=1 --gamma=1.0 --metric=fvd2048_16f
Random seed: 454557645
wandb: (1) Create a W&B account
wandb: (2) Use an existing W&B account
wandb: (3) Don't visualize my results
wandb: Enter your choice: 3
wandb: You chose "Don't visualize my results"
wandb: Tracking run with wandb version 0.13.10
wandb: W&B syncing is set to `offline` in this directory.  
wandb: Run `wandb online` or set WANDB_MODE=online to enable cloud syncing.
Setting up PyTorch plugin "bias_act_plugin"... Done.
Setting up PyTorch plugin "upfirdn2d_plugin"... Done.
Loading video datasets... 0.00s
Traceback (most recent call last):
  File "train_sres.py", line 410, in <module>
    main()
  File "/home/lweingart/.virtualenvs/boomGAN/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/lweingart/.virtualenvs/boomGAN/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/lweingart/.virtualenvs/boomGAN/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/lweingart/.virtualenvs/boomGAN/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "train_sres.py", line 403, in main
    train(**c)
  File "train_sres.py", line 98, in train
    dataset = VideoDatasetTwoRes(
  File "<string>", line 13, in __init__
  File "/home/lweingart/git/long-video-gan/dataset.py", line 122, in __post_init__
    self.lr_dataset = VideoDataset(
  File "<string>", line 11, in __init__
  File "/home/lweingart/git/long-video-gan/dataset.py", line 41, in __post_init__
    assert self.dataset_path.is_dir(), self.dataset_path
AssertionError: dataset/0720x1280/0036x0064
wandb: Waiting for W&B process to finish... (failed 1).
wandb: You can sync this run to the cloud by running:
wandb: wandb sync runs/sres/00007-0720x1280-1batch-1accum-1.0gamma/wandb/offline-run-20230226_115711-wa2uijui
wandb: Find logs at: runs/sres/00007-0720x1280-1batch-1accum-1.0gamma/wandb/offline-run-20230226_115711-wa2uijui/logs

Thank you very much in advance for your help in understanding the issue

Cheers

EDIT: I changed the command to prepare the dataset using --height=36 and --height=64, then it complained not seeing the 0144x0256. I did it again with --width=144 and --height=256 and this error disappeared (I got new ones, but that's probably expected seeing that my dataset is not of these res at all).
(

File "train_sres.py", line 403, in main
    train(**c)
  File "train_sres.py", line 124, in train
    index = torch.randint(len(result_dataset) // world_size, (), generator=generator).item()
RuntimeError: random_ expects 'from' to be less than 'to', but got from=0 >= to=0

)

I guess this answers my question, but could you please confirm that there is no way to use a different resolution for our datasets ?

Thank you for the help

Well, I should have better RTFM.
These values can be set directly in the code.

Sorry for bothering you