ultralytics / xview-yolov3

xView 2018 Object Detection Challenge: YOLOv3 Training and Inference.
https://docs.ultralytics.com
GNU Affero General Public License v3.0
256 stars 57 forks source link

Inference taking forever for a 3000x4000 aerial image #11

Closed koutilya-pnvr closed 4 years ago

koutilya-pnvr commented 5 years ago

I am trying to test this repo on an aerial image with 3000x4000 resolution. It seems to me that the detect.py is taking forever to output the corresponding output image. I am using the following command: python detect.py -image_folder data/samples/ -output_folder output_myimg/ -img_size 4000 -conf_thres=0.6

Python 3.7 pytorch 1.0.1 cudatoolkit 8.0

Any idea whats going wrong?

koutilya-pnvr commented 5 years ago

It actually exited with an error:

0 (3, 3000, 4000) row 0/1: 0 Traceback (most recent call last): File "detect.py", line 273, in detect(opt) File "detect.py", line 119, in detect pred = model(chip) File "/fs/vulcan-scratch/koutilya/scratch0/koutilya/installs/anaconda2/envs/torch_0.4_py3.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, kwargs) File "/fs/vulcan-scratch/koutilya/projects/xview-yolov3/models.py", line 236, in forward x = module(x) File "/fs/vulcan-scratch/koutilya/scratch0/koutilya/installs/anaconda2/envs/torch_0.4_py3.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, *kwargs) File "/fs/vulcan-scratch/koutilya/scratch0/koutilya/installs/anaconda2/envs/torch_0.4_py3.7/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward input = module(input) File "/fs/vulcan-scratch/koutilya/scratch0/koutilya/installs/anaconda2/envs/torch_0.4_py3.7/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, kwargs) File "/fs/vulcan-scratch/koutilya/projects/xview-yolov3/models.py", line 120, in forward p = p.view(bs, self.nA, self.bbox_attrs, nG, nG).permute(0, 1, 3, 4, 2).contiguous() # prediction RuntimeError: shape '[1, 10, 65, 32, 32]' is invalid for input of size 2600000

How should I properly test a 3000x4000 aerial image? Any help appreciated!

glenn-jocher commented 5 years ago

Be advised that the https://github.com/ultralytics/xview-yolov3 repository is not under active development anymore. We recommend you use https://github.com/ultralytics/yolov3 instead, our main YOLOv3 repository.

fadishaar84 commented 5 years ago

@koutilya40192 Did you solve the error? I'm facing the same issue.

koutilya-pnvr commented 5 years ago

@fadishaar84 no i didn't.

DogukanAltay commented 5 years ago

@fadishaar84 @koutilya40192 Did you update lines 27 and 51 with "True" and "cuda:0". Probably parsing and doing inference with cpu on such big images takes too much time.

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 30 days with no activity. Remove Stale label or comment or this will be closed in 5 days.