DexiNed icon indicating copy to clipboard operation
DexiNed copied to clipboard

AttributeError: Caught AttributeError in DataLoader worker process 0.

Open emmmmmmmer opened this issue 2 years ago • 2 comments

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

emmmmmmmer avatar Jul 07 '21 08:07 emmmmmmmer

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

xavysp avatar Jul 09 '21 20:07 xavysp

Thank you for your help

emmmmmmmer avatar Jul 10 '21 13:07 emmmmmmmer