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

AttributeError: Caught AttributeError in DataLoader worker process 0. #80

Open
emmmmmmmer opened this issue Jul 7, 2021 · 2 comments
Open

Comments

@emmmmmmmer
Copy link

Hello, I'm sorry to disturb you, I want to ask you some questions. I use your program to perform edge extraction on my own data images, but errors will occur when the program runs. There will be some images in my data set images that cannot be edge extracted. Hope your reply, thank you

/home/lu/anaconda3/envs/python37/bin/python3.7 /home/lu/DexiNed-master/main.py
/home/lu/anaconda3/envs/python37/lib/python3.7/site-packages/kornia/augmentation/augmentation.py:1875: DeprecationWarning: GaussianBlur is no longer maintained and will be removed from the future versions. Please use RandomGaussianBlur instead.
category=DeprecationWarning,
Number of GPU's available: 1
Pytorch version: 1.7.1+cu101
mean_bgr: [103.939, 116.779, 123.68]
output_dir: result/BIPED2CLASSIC
Restoring weights from: checkpoints/BIPED/14/14_model.pth
actual size: (480, 640, 3), target size: (512, 512)
actual size: (480, 640, 3), target size: (512, 512)
Traceback (most recent call last):
File "/home/lu/DexiNed-master/main.py", line 441, in
main(args)
File "/home/lu/DexiNed-master/main.py", line 390, in main
test(checkpoint_path, dataloader_val, model, device, output_dir, args)
File "/home/lu/DexiNed-master/main.py", line 125, in test
for batch_id, sample_batched in enumerate(dataloader):
File "/home/lu/anaconda3/envs/python37/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in next
data = self._next_data()
File "/home/lu/anaconda3/envs/python37/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1085, in _next_data
return self._process_data(data)
File "/home/lu/anaconda3/envs/python37/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1111, in _process_data
data.reraise()
File "/home/lu/anaconda3/envs/python37/lib/python3.7/site-packages/torch/_utils.py", line 428, in reraise
raise self.exc_type(msg)
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/lu/anaconda3/envs/python37/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/home/lu/anaconda3/envs/python37/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/lu/anaconda3/envs/python37/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/lu/DexiNed-master/datasets.py", line 233, in getitem
im_shape = [image.shape[0], image.shape[1]]
AttributeError: 'NoneType' object has no attribute 'shape'

Process finished with exit code 1

@xavysp
Copy link
Owner

xavysp commented Jul 9, 2021

Hi, welcome on board. Somehow it is not reading your images. Try printing your image path before image.shape

@emmmmmmmer
Copy link
Author

Thank you for your help

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

2 participants