Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ArnabSen123 opened this issue Oct 17, 2024 · 0 comments

Comments

@ArnabSen123
Copy link

ArnabSen123 commented Oct 17, 2024

Hi, I am new to machine learning and has little experience with coding related to this field. I am stuck at this problem for a long time. Can anyone tell me what change should I make to solve this problem. I have provided my parameters and error log below. I am currently working on this for my university thesis. It will be very much helpful if anyone help me in this matter.

##parameters
!python /content/Efficient-3DCNNs/main.py --root_path /content/Efficient-3DCNNs
--video_path /content/Efficient-3DCNNs/jester/
--annotation_path /content/Efficient-3DCNNs/annotation_Jester/jester.json
--result_path /content/Efficient-3DCNNs/results
--pretrain_path Efficient-3DCNNs/results/kinetics_shufflenet_0.5x_G3_RGB_16_best.pth
--dataset ucf101
--n_classes 600
--n_finetune_classes 101
--ft_portion last_layer
--model shufflenet
--groups 3
--width_mult 0.5
--train_crop random
--learning_rate 0.1
--sample_duration 16
--downsample 1
--batch_size 64
--n_threads 16
--checkpoint 1
--n_val_samples 1 \

error log

/content/Efficient-3DCNNs/jester/20-bn-jester/82241
/content/Efficient-3DCNNs/jester/20-bn-jester/18224
/content/Efficient-3DCNNs/jester/20-bn-jester/99358
/content/Efficient-3DCNNs/jester/20-bn-jester/75507
/content/Efficient-3DCNNs/jester/20-bn-jester/48433
/content/Efficient-3DCNNs/jester/20-bn-jester/146421
/content/Efficient-3DCNNs/jester/20-bn-jester/49514
/content/Efficient-3DCNNs/jester/20-bn-jester/4502
Traceback (most recent call last):
File "/content/Efficient-3DCNNs/main.py", line 90, in
train_loader = torch.utils.data.DataLoader(
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/dataloader.py", line 351, in init
sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type]
File "/usr/local/lib/python3.10/dist-packages/torch/utils/data/sampler.py", line 144, 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

The dataset that I used are from kaggle repository which contains a subset of 20bn-jester dataset

!kaggle datasets download -d toxicmender/20bn-jester
and I have unzipped the file before use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant