dingjiansw101 / AerialDetection

Apache License 2.0
793 stars 183 forks source link

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

Closed zhaojingru408 closed 3 years ago

zhaojingru408 commented 3 years ago

where I run tools/test.py ,I have the following problems: for i, data in enumerate(data_loader): File "/home/zjr/anaconda3/envs/AerialDetection/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 582, in next return self._process_next_batch(batch) File "/home/zjr/anaconda3/envs/AerialDetection/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch raise batch.exc_type(batch.exc_msg) AttributeError: Traceback (most recent call last): File "/home/zjr/anaconda3/envs/AerialDetection/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/zjr/anaconda3/envs/AerialDetection/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in samples = collate_fn([dataset[i] for i in batch_indices]) File "/media/sdc/zjr/code/AerialDetection/mmdet/datasets/custom.py", line 197, in getitem return self.prepare_test_img(idx) File "/media/sdc/zjr/code/AerialDetection/mmdet/datasets/custom.py", line 378, in prepare_test_img img, scale, False, proposal) File "/media/sdc/zjr/code/AerialDetection/mmdet/datasets/custom.py", line 332, in prepare_single img, scale, flip, keep_ratio=self.resize_keep_ratio) File "/media/sdc/zjr/code/AerialDetection/mmdet/datasets/transforms.py", line 33, in call img, scale_factor = mmcv.imrescale(img, scale, return_scale=True) File "/home/zjr/anaconda3/envs/AerialDetection/lib/python3.7/site-packages/mmcv/image/resize.py", line 132, in imrescale h, w = img.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape'

I'm sure the image exists and no Chinese path. If you have already identified the reason, you can provide the information here. Thanks

s2016455 commented 3 years ago

Some problem. Have you solved it?