pytorch-vdsr icon indicating copy to clipboard operation
pytorch-vdsr copied to clipboard

About loading data files

Open cg-6x opened this issue 4 years ago • 0 comments

Hi, dear Jiu, thank you for sharing the code.

I use the given data generation code to generate the corresponding. h5 file for 291 images, but running main_ vdsr.py ,the following errors will be reported, ===> Loading datasets Traceback (most recent call last): File "main_vdsr.py", line 138, in main() File "main_vdsr.py", line 54, in main training_data_loader = DataLoader(dataset=train_set, num_workers=opt.threads, batch_size=opt.batchSize, shuffle=True) File "/root/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 213, in init sampler = RandomSampler(dataset) File "/root/anaconda3/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 92, in init if not isinstance(self.num_samples, int) or self.num_samples <= 0: File "/root/anaconda3/lib/python3.7/site-packages/torch/utils/data/sampler.py", line 100, in num_samples return len(self.data_source) File "/home/thw/Desktop/Cg/VDSR/pytorch-vdsr-master/dataset.py", line 16, in len return self.data.shape[0] AttributeError: 'NoneType' object has no attribute 'shape' I confirm that my training data is generated according to the code for data generation. What is the reason?

cg-6x avatar Jul 27 '20 07:07 cg-6x