alibaba / animate-anything

Fine-Grained Open Domain Image Animation with Motion Guidance
https://animationai.github.io/AnimateAnything/
MIT License
779 stars 63 forks source link

ValueError: num_samples should be a positive integer value, but got num_samples=0 #23

Closed dailingx closed 10 months ago

dailingx commented 10 months ago

I get an error when run with python train_svd.py --config example/train_svd.yaml pretrained_model_path=/root/sspaas-fs/stable-video-diffusion-img2vid-xt.

16 Attention layers using Scaled Dot Product Attention.
dataset: video_blip
Non-existant JSON path. Skipping.
train_datasets: <utils.dataset.VideoBLIPDataset object at 0x7fe54c3e3ca0>
Traceback (most recent call last):
  File "train_svd.py", line 1007, in <module>
    main(**args_dict)
  File "train_svd.py", line 701, in main
    train_dataloader = torch.utils.data.DataLoader(
  File "/root/sspaas-fs/animate-anything/venv/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 351, in __init__
    sampler = RandomSampler(dataset, generator=generator)  # type: ignore[arg-type]
  File "/root/sspaas-fs/animate-anything/venv/lib/python3.8/site-packages/torch/utils/data/sampler.py", line 107, in __init__
    raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0

my video dataset is set up and I don't know what could be causing this error.

dailingx commented 10 months ago

I added a little error stack in train_svd.py to locate the problem and solved it. I will submit a PR later.