WellyZhang / CoPINet

Learning Perceptual Inference by Contrasting

Home Page:http://wellyzhang.github.io/project/copinet.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

dhar7 opened this issue · comments

I am using CoPINET on my Colaboratory . while running
!python /content/CoPINet/src/main.py train --dataset "/content/drive/MyDrive/sample2/center_single"

the following error occurs
Traceback (most recent call last):
File "/content/CoPINet/src/main.py", line 262, in
main()
File "/content/CoPINet/src/main.py", line 253, in main
train(args, device)
File "/content/CoPINet/src/main.py", line 122, in train
train_loader = DataLoader(train_set, batch_size=args.batch_size, shuffle=True, num_workers=args.num_workers)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 268, in init
sampler = RandomSampler(dataset, generator=generator)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/sampler.py", line 103, in init
"value, but got num_samples={}".format(self.num_samples))
ValueError: num_samples should be a positive integer value, but got num_samples=0

**I have mounted google drive on my Colab and this folder /content/drive/MyDrive/sample2/center_single contains 10 sample training data (RAVEN_0_train.npz , RAVEN_0_train.xml , ........... , RAVEN_9_train.npz , RAVEN_9_train.xml)

Sorry that I have never tried running the code on colab. But it looks like a data loading problem. Any possibility of trying a local version? The code works fine on my local device.

Screenshot from 2021-11-25 01-08-01

trying it on local device ? What could be the solution?

Thanks in advance

Try Python2? Looks like there are some compatibility issues with Python3.

now using python2 but the same error occurs....any other solutions?

Should set the dataset arg to the parent folder, not a specific split