speedinghzl / CCNet

CCNet: Criss-Cross Attention for Semantic Segmentation (TPAMI 2020 & ICCV 2019).
MIT License
1.42k stars 277 forks source link

AttributeError: 'NoneType' object has no attribute 'shape' #34

Open tong1101 opened 5 years ago

tong1101 commented 5 years ago

AttributeError: Traceback (most recent call last): File "/home/ydc/anaconda3/envs/tl_pytorch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/ydc/anaconda3/envs/tl_pytorch/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 106, in samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/ydc/tl/pytorch/CCNet-master/dataset/datasets.py", line 178, in getitem size = image.shape AttributeError: 'NoneType' object has no attribute 'shape'

HOW TO SOLVE IT?

speedinghzl commented 5 years ago

Please check your cityscape image and label paths are accessible.

tong1101 commented 5 years ago

@speedinghzl I check it and I still can't solve the problem

swjtulinxi commented 4 years ago

i have the same problem

Wj8066 commented 3 years ago

i have the same problem

How is it going on about the problem? I have the same problem.

tong1101 commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

fan-lucky commented 2 years ago

Traceback (most recent call last): File "train.py", line 245, in main() File "train.py", line 213, in main images, labels, , = dataloader.next() File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 652, in next data = self._next_data() File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1347, in _next_data return self._process_data(data) File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1373, in _process_data data.reraise() File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/_utils.py", line 461, in reraise raise exception AttributeError: Caught AttributeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/CCNet-pure-python/dataset/datasets.py", line 177, in getitem label = self.id2trainId(label) File "/root/CCNet-pure-python/dataset/datasets.py", line 164, in id2trainId label_copy = label.copy() AttributeError: 'NoneType' object has no attribute 'copy'

I have problem about Nonetype,and am looking forward to your reply!

tong1101 commented 2 years ago

Sorry, I don't do related work anymore

------------------ 原始邮件 ------------------ 发件人: "speedinghzl/CCNet" @.>; 发送时间: 2022年7月21日(星期四) 中午1:09 @.>; @.**@.>; 主题: Re: [speedinghzl/CCNet] AttributeError: 'NoneType' object has no attribute 'shape' (#34)

Traceback (most recent call last): File "train.py", line 245, in main() File "train.py", line 213, in main images, labels, , = dataloader.next() File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 652, in next data = self._next_data() File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1347, in _next_data return self._process_data(data) File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1373, in _process_data data.reraise() File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/_utils.py", line 461, in reraise raise exception AttributeError: Caught AttributeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/miniconda3/envs/ccnet/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/CCNet-pure-python/dataset/datasets.py", line 177, in getitem label = self.id2trainId(label) File "/root/CCNet-pure-python/dataset/datasets.py", line 164, in id2trainId label_copy = label.copy() AttributeError: 'NoneType' object has no attribute 'copy'

I have problem about Nonetype,and am looking forward to your reply!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

tong1101 commented 2 years ago

Sorry, I don't do related work anymore

------------------ 原始邮件 ------------------ 发件人: "speedinghzl/CCNet" @.>; 发送时间: 2022年7月21日(星期四) 中午1:08 @.>; @.**@.>; 主题: Re: [speedinghzl/CCNet] AttributeError: 'NoneType' object has no attribute 'shape' (#34)

I have problem about Nonetype,and am looking forward to your reply!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>