lucidrains / recurrent-interface-network-pytorch

Implementation of Recurrent Interface Network (RIN), for highly efficient generation of images and video without cascading networks, in Pytorch
MIT License
194 stars 14 forks source link

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

Open ad48hp opened 7 months ago

ad48hp commented 7 months ago

When running the Trainer example script from readme, the program fails to run with the following error: Traceback (most recent call last): File "RIN.py", line 20, in <module> trainer = Trainer( File "<@beartype(rin_pytorch.rin_pytorch.Trainer.__init__) at 0x2c1dc307d30>", line 32, in __init__ File "C:\Python38\lib\site-packages\rin_pytorch\rin_pytorch.py", line 973, in __init__ dl = DataLoader(self.ds, batch_size = train_batch_size, shuffle = True, pin_memory = True, num_workers = cpu_count()) File "C:\Python38\lib\site-packages\torch\utils\data\dataloader.py", line 350, in __init__ sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type] File "C:\Python38\lib\site-packages\torch\utils\data\sampler.py", line 143, in __init__ raise ValueError(f"num_samples should be a positive integer value, but got num_samples={self.num_samples}") ValueError: num_samples should be a positive integer value, but got num_samples=0

Any idea on how to fix ?

More information torch 2.2.0+cu121 The image folder contains 71 images in PNG format.

All packages packages.txt

eml-and commented 7 months ago

I had the same error however it was an easy fix in my case, as the path to the images was wrong and thus num_samples=0