open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.68k stars 9.48k forks source link

Getting, ValueError: cannot reshape array of size 2560800 into shape (800,800) on custom training data. #10655

Open gauravjio opened 1 year ago

gauravjio commented 1 year ago

Hi Team,

I am facing an issue to initiate training on custom data. Please have a look on attached screenshot.

Though , It seems it have annotation related issue , could someone please share how to identify with which image i am getting.

ValueError: Caught ValueError in DataLoader worker process 1. Original Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\openmmlab\lib\site-packages\torch\utils\data\_utils\worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "C:\ProgramData\Anaconda3\envs\openmmlab\lib\site-packages\torch\utils\data\_utils\fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\ProgramData\Anaconda3\envs\openmmlab\lib\site-packages\torch\utils\data\_utils\fetch.py", line 49, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\Users\azureuser\Documents\Crop Anomaly Detection\mmdet\datasets\custom.py", line 218, in __getitem__ data = self.prepare_train_img(idx) File "C:\Users\azureuser\Documents\Crop Anomaly Detection\mmdet\datasets\custom.py", line 241, in prepare_train_img return self.pipeline(results) File "C:\Users\azureuser\Documents\Crop Anomaly Detection\mmdet\datasets\pipelines\compose.py", line 41, in __call__ data = t(data) File "C:\Users\azureuser\Documents\Crop Anomaly Detection\mmdet\datasets\pipelines\transforms.py", line 665, in __call__ self._pad_masks(results) File "C:\Users\azureuser\Documents\Crop Anomaly Detection\mmdet\datasets\pipelines\transforms.py", line 645, in _pad_masks results[key] = results[key].pad(pad_shape, pad_val=pad_val) File "C:\Users\azureuser\Documents\Crop Anomaly Detection\mmdet\core\mask\structures.py", line 312, in pad return BitmapMasks(padded_masks, *out_shape) File "C:\Users\azureuser\Documents\Crop Anomaly Detection\mmdet\core\mask\structures.py", line 235, in __init__ self.masks = np.stack(masks).reshape(-1, height, width) ValueError: cannot reshape array of size 2560800 into shape (800,800)

Thanks Gaurav

pkyzh2006 commented 2 weeks ago

have you solved the issue?