pytorch 1.0 version - error on custom COCO dataset
See original GitHub issuerunning a custom dataset, seeing the following
Appending horizontally-flipped training examples...
coco_try_20190419_train gt roidb loaded from /media/latest_mount/Dev/git/EMCP/faster-rcnn.pytorch/data/cache/coco_try_20190419_train_gt_roidb.pkl
done
Preparing training data...
Backend TkAgg is interactive backend. Turning interactive mode on.
done
loading annotations into memory.../media/latest_mount/Dev/git/EMCP/faster-rcnn.pytorch/data/coco_try_20190419/annotations/instances_train_20190419.json at 1556370591.791137
Done (t=0.00s)
creating index...
index created!
before filtering, there are 254 images...
after filtering, there are 254 images...
254 roidb entries
Loading pretrained weights from data/pretrained_model/resnet101_caffe.pth
Traceback (most recent call last):
File "/home/emcp/Tools/pycharm-community-2018.2.4/helpers/pydev/pydevd.py", line 1741, in <module>
main()
File "/home/emcp/Tools/pycharm-community-2018.2.4/helpers/pydev/pydevd.py", line 1735, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/emcp/Tools/pycharm-community-2018.2.4/helpers/pydev/pydevd.py", line 1135, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/emcp/Tools/pycharm-community-2018.2.4/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/media/latest_mount/Dev/git/EMCP/faster-rcnn.pytorch/trainval_net.py", line 322, in <module>
data = next(data_iter)
File "/home/emcp/anaconda3/envs/pytorch1_py36/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 615, in __next__
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/home/emcp/anaconda3/envs/pytorch1_py36/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 615, in <listcomp>
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/media/latest_mount/Dev/git/EMCP/faster-rcnn.pytorch/lib/roi_data_layer/roibatchLoader.py", line 67, in __getitem__
blobs = get_minibatch(minibatch_db, self._num_classes)
File "/media/latest_mount/Dev/git/EMCP/faster-rcnn.pytorch/lib/roi_data_layer/minibatch.py", line 30, in get_minibatch
im_blob, im_scales = _get_image_blob(roidb, random_scale_inds)
File "/media/latest_mount/Dev/git/EMCP/faster-rcnn.pytorch/lib/roi_data_layer/minibatch.py", line 79, in _get_image_blob
cfg.TRAIN.MAX_SIZE)
File "/media/latest_mount/Dev/git/EMCP/faster-rcnn.pytorch/lib/model/utils/blob.py", line 39, in prep_im_for_blob
im -= pixel_means
ValueError: operands could not be broadcast together with shapes (1880,2880,4) (1,1,3) (1880,2880,4)
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
COCO evaluation can fail for custom datasets which ... - GitHub
The COCO evaluation pipeline in references/detection (also used in the object detection finetuning tutorial here) can fail if the custom dataset ...
Read more >Train an Object Detector with your own 'COCO' dataset in ...
Hi Guys, I am pretty new using PyTorch, I have successfully trained ... to train on my custom dataset (coco format) i got...
Read more >Pytorch Faster R-CNN size mismatch errors in testing
When running test_net.py in pytorch1.0 Faster R-CNN and demo.py on coco dataset with faster_rcnn_1_10_9771.pth(the pretrained resnet101 ...
Read more >How to work with object detection datasets in COCO format
Due to the popularity of the dataset, the format that COCO uses to store annotations is often the go-to format when creating a...
Read more >Tutorial 2: Customize Datasets - MMDetection's documentation!
In MMDetection, we recommend to convert the data into COCO formats and do the conversion offline, thus you only need to modify the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you have to change it in two places… once in the training python file, and one in the demo…
if you detect 4 channels, and you’re sure that the alpha channel is unused, go ahead and transform the image using python… to only 3 channels
https://github.com/jwyang/faster-rcnn.pytorch/blob/master/demo.py#L115-L118
Have you guys solved it??