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

About loading data files #38

Open
cg-6x opened this issue Jul 27, 2020 · 0 comments
Open

About loading data files #38

cg-6x opened this issue Jul 27, 2020 · 0 comments

Comments

@cg-6x
Copy link

cg-6x commented Jul 27, 2020

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?

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