3D-ResNets-PyTorch icon indicating copy to clipboard operation
3D-ResNets-PyTorch copied to clipboard

Problem with train_loader

Open siyalsonarkar18 opened this issue 5 years ago • 8 comments

When I'm running the main.py file, I'm getting this error: File "main.py", line 88, in pin_memory=True) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 213, in init sampler = RandomSampler(dataset) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 94, 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

How is the num_samples = 0?

siyalsonarkar18 avatar Dec 11 '19 02:12 siyalsonarkar18

have you solve this problem? i meet same error please tell me

lrhjw avatar Mar 23 '20 07:03 lrhjw

have you solve this problem? i meet same error please tell me

check your path of jpg files

sudonto avatar May 03 '20 16:05 sudonto

@sudonto I can create the json file ,so i think my path of jpg is true

lrhjw avatar May 06 '20 11:05 lrhjw

my file like this: root_path/data/ jpg/ action1/ action2/ ucf101_01.json
and my code to trian is: python main.py --root_path /home/zc/coode/3D-ResNets-PyTorch --video_path data/jpg --annotation_path data/ucf101_01.json --result_path results --dataset ucf101 --model resnet --model_depth 34 --n_classes 4 --batch_size 128 --n_threads 4 --checkpoint 5 @sudonto

lrhjw avatar May 06 '20 11:05 lrhjw

I think you should pay more attention here: https://github.com/kenshohara/3D-ResNets-PyTorch/blob/05a8a5e7f4feff0c6e0c0f1a498f191433c8e37c/datasets/loader.py#L32 and https://github.com/kenshohara/3D-ResNets-PyTorch/blob/05a8a5e7f4feff0c6e0c0f1a498f191433c8e37c/datasets/videodataset.py#L38

Those files are resposinsble to load images, if it is fail then ValueError will raise. Note, I assume you have correctly created json file.

sudonto avatar May 06 '20 12:05 sudonto

@sudonto thank you i will try

lrhjw avatar May 06 '20 12:05 lrhjw

@lrhjw did you solve it? i got same problem

Chaoran-F avatar Nov 14 '20 06:11 Chaoran-F

Is there any possibility of having data described in your annotation json that doesn't exist in your disk? or videos without fps information in the annotations? like empty or zero.

guilhermesurek avatar Nov 16 '20 12:11 guilhermesurek