HRNet / HRNet-Semantic-Segmentation

The OCR approach is rephrased as Segmentation Transformer: https://arxiv.org/abs/1909.11065. This is an official implementation of semantic segmentation for HRNet. https://arxiv.org/abs/1908.07919
Other
3.09k stars 683 forks source link

python tools/test.py --cfg experiments/lip/seg_hrnet_w48_473x473_sgd_lr7e-3_wd5e-4_bs_40_epoch150.yaml DATASET.TEST_SET list/lip/testvalList.txt TEST.MODEL_FILE hrnet_w48_lip_cls20_473x473_pytorch-v11.pth TEST.FLIP_TEST True TEST.NUM_SAMPLES 0 #195

Open enxi3629 opened 3 years ago

enxi3629 commented 3 years ago

Traceback (most recent call last): File "tools/test.py", line 150, in main() File "tools/test.py", line 119, in main for i,j in testloader: File "C:\Anaconda\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 819, in next return self._process_data(data) File "C:\Anaconda\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 846, in _process_data data.reraise() File "C:\Anaconda\envs\pytorch\lib\site-packages\torch_utils.py", line 369, in reraise raise self.exc_type(msg) AttributeError: Caught AttributeError in DataLoader worker process 0. Original Traceback (most recent call last): File "C:\Anaconda\envs\pytorch\lib\site-packages\torch\utils\data_utils\worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "C:\Anaconda\envs\pytorch\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\Anaconda\envs\pytorch\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\HRNet\HRNet-Semantic-Segmentation-HRNet-OCR\tools..\lib\datasets\lip.py", line 90, in getitem size = label.shape AttributeError: 'NoneType' object has no attribute 'shape'

richenyunqi commented 3 years ago

the same error. Can you help us fix it? @sunke123

NikhilChowdary-MCW commented 3 years ago

Hi @enxi3629 and @richenyunqi , Usually this error occurs when there is an invalid path to the images that are written in .lst files.

Suppose there are 100 images for training and those path was written in .lst files. If one picture path was written and at that path if the image is not present, that the system will through up this error.

Try to debug it and if you feel there are many images that you cannot check, split the .lst file using python code and try to test for small .lst files, then you will know where's the issue.