CenterNet icon indicating copy to clipboard operation
CenterNet copied to clipboard

run demo error

Open popruckyowlHistory opened this issue 7 years ago • 20 comments

CenterNet work on ubuntu16.04+pytorch0.4.1+python3.5+cuda9.0

When I set the --demo '/home/didi/data/247.png' --load_model '/home/didi/Documents/CenterNet-master/models/ctdet_coco_dla_2x.pth', and run the demo.py on ctdet mode.

I got the following error:

Fix size testing. training chunk_sizes: [8] The output will be saved to /home/didi/Documents/CenterNet-master/src/lib/../../exp/ctdet/default heads {'wh': 2, 'reg': 2, 'hm': 80} Creating model... loaded /home/didi/Documents/CenterNet-master/models/ctdet_coco_dla_2x.pth, epoch 230 THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=663 error=2 : out of memory Traceback (most recent call last): File "/home/didi/software/pycharm-2019.1.1/helpers/pydev/pydevd.py", line 1741, in main() File "/home/didi/software/pycharm-2019.1.1/helpers/pydev/pydevd.py", line 1735, in main globals = debugger.run(setup['file'], None, None, is_module) File "/home/didi/software/pycharm-2019.1.1/helpers/pydev/pydevd.py", line 1135, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/home/didi/software/pycharm-2019.1.1/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/didi/Documents/CenterNet-master/src/demo.py", line 59, in demo(opt) File "/home/didi/Documents/CenterNet-master/src/demo.py", line 50, in demo ret = detector.run(image_name) File "/home/didi/Documents/CenterNet-master/src/lib/detectors/base_detector.py", line 116, in run output, dets, forward_time = self.process(images, return_time=True) File "/home/didi/Documents/CenterNet-master/src/lib/detectors/ctdet.py", line 26, in process output = self.model(images)[-1] File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/home/didi/Documents/CenterNet-master/src/lib/models/networks/pose_dla_dcn.py", line 481, in forward z[head] = self.getattr(head)(y[-1]) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/container.py", line 91, in forward input = module(input) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/conv.py", line 301, in forward self.padding, self.dilation, self.groups) RuntimeError: CUDA error: out of memory

Then I used pycharm to check where the error occurred, I found it stop at 26 of ctdet.py. The model loaded correctly, however, no matter what size of 247.png I gave, it just couldn't pass.

How can I solve this problem?

popruckyowlHistory avatar May 14 '19 15:05 popruckyowlHistory

Hi, Even I have encountered this error of CUDA out of memory. Any idea on the cause of this error? I am working with Ubuntu18.04, 2080 RTX Ti, cuda-9.0, pytorch 0.4.1, python3.5. Thanks.

nanditam1 avatar May 15 '19 09:05 nanditam1

DLA takes less than 2G GPU memory in my machine. Please check if your GPU is occupied by other programs.

xingyizhou avatar May 16 '19 04:05 xingyizhou

I encountered the same problem, my GPU memory is not occupied

westpilgrim avatar May 17 '19 08:05 westpilgrim

even I add the tag --batch_size 1 ,still the same problem

westpilgrim avatar May 17 '19 08:05 westpilgrim

forget to mention that my gpu memory is 6g

westpilgrim avatar May 17 '19 08:05 westpilgrim

I also encountered this error of CUDA out of memory,I am working with Ubuntu16.04, 2080 RTX Ti, cuda-9.0, pytorch 0.4.1, python3.6,my GPU memory is 8G.

lvbubu avatar May 20 '19 08:05 lvbubu

Hi, Even I have encountered this error of CUDA out of memory. Any idea on the cause of this error? I am working with Ubuntu18.04, 2080 RTX Ti, cuda-9.0, pytorch 0.4.1, python3.5. Thanks.

I encountered the same problem with Ubuntu16.04, 2080 RTX Ti, cuda-9.0, pytorch 0.4.1, python3.6 . Maybe it is because 2080 RTX Ti needs cuda10 and needs to install pytorch by source code. I will not have this issue when I change a machine with Tesla v100, cuda-9.0, pytorch 0.4.1, python3.7.

lvbubu avatar May 22 '19 08:05 lvbubu

My problem is the os.environ['CUDA_VISIBLE_DEVICES'] = opt.gpus_str. We need to set --gpus (default=0) to choose which GPU can be used. It works for me.

WangyiNTU avatar May 22 '19 14:05 WangyiNTU

Hi, Even I have encountered this error of CUDA out of memory. Any idea on the cause of this error? I am working with Ubuntu18.04, 2080 RTX Ti, cuda-9.0, pytorch 0.4.1, python3.5. Thanks.

I encountered the same problem with Ubuntu16.04, 2080 RTX Ti, cuda-9.0, pytorch 0.4.1, python3.6 . Maybe it is because 2080 RTX Ti needs cuda10 and needs to install pytorch by source code. I will not have this issue when I change a machine with Tesla v100, cuda-9.0, pytorch 0.4.1, python3.7.

Hi, I am having trouble installing pytorch 0.4.1 from source in cuda-10.0. Keep getting this error : THCAtomics.cuh(100): error: cannot overload functions distinguished by return type alone. ubuntu version : 18.04. Any clues why this is happening?

nanditam1 avatar May 23 '19 05:05 nanditam1

Having the same issue with RTX2070 and CUDA10.

Any resolutions yet?

vivekpd15 avatar Jun 04 '19 18:06 vivekpd15

CenterNet work on ubuntu16.04+pytorch0.4.1+python3.5+cuda9.0

When I set the --demo '/home/didi/data/247.png' --load_model '/home/didi/Documents/CenterNet-master/models/ctdet_coco_dla_2x.pth', and run the demo.py on ctdet mode.

I got the following error:

Fix size testing. training chunk_sizes: [8] The output will be saved to /home/didi/Documents/CenterNet-master/src/lib/../../exp/ctdet/default heads {'wh': 2, 'reg': 2, 'hm': 80} Creating model... loaded /home/didi/Documents/CenterNet-master/models/ctdet_coco_dla_2x.pth, epoch 230 THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=663 error=2 : out of memory Traceback (most recent call last): File "/home/didi/software/pycharm-2019.1.1/helpers/pydev/pydevd.py", line 1741, in main() File "/home/didi/software/pycharm-2019.1.1/helpers/pydev/pydevd.py", line 1735, in main globals = debugger.run(setup['file'], None, None, is_module) File "/home/didi/software/pycharm-2019.1.1/helpers/pydev/pydevd.py", line 1135, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/home/didi/software/pycharm-2019.1.1/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/didi/Documents/CenterNet-master/src/demo.py", line 59, in demo(opt) File "/home/didi/Documents/CenterNet-master/src/demo.py", line 50, in demo ret = detector.run(image_name) File "/home/didi/Documents/CenterNet-master/src/lib/detectors/base_detector.py", line 116, in run output, dets, forward_time = self.process(images, return_time=True) File "/home/didi/Documents/CenterNet-master/src/lib/detectors/ctdet.py", line 26, in process output = self.model(images)[-1] File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/home/didi/Documents/CenterNet-master/src/lib/models/networks/pose_dla_dcn.py", line 481, in forward z[head] = self.getattr(head)(y[-1]) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/container.py", line 91, in forward input = module(input) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/module.py", line 477, in call result = self.forward(*input, **kwargs) File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/conv.py", line 301, in forward self.padding, self.dilation, self.groups) RuntimeError: CUDA error: out of memory

Then I used pycharm to check where the error occurred, I found it stop at 26 of ctdet.py. The model loaded correctly, however, no matter what size of 247.png I gave, it just couldn't pass.

How can I solve this problem?

hi have you solved the out of memory problem?

westpilgrim avatar Jun 06 '19 11:06 westpilgrim

Having the same issue with RTX2070 and CUDA10.

Any resolutions yet?

hi have you solved this?

westpilgrim avatar Jun 07 '19 09:06 westpilgrim

Check if your GPU has enough memory allocated for the process to run. That's the main issue for CUDA out of memory errors.

PRYUS avatar Jun 18 '19 08:06 PRYUS

i run it with 2080ti cuda9 cudnn7.3.1 ,i have also meet the same issue with you,have you solve it? @westpilgrim @popruckyowl

CompliceU avatar Jun 24 '19 08:06 CompliceU

i run it with 2080ti cuda9 cudnn7.3.1 ,i have also meet the same issue with you,have you solve it? @westpilgrim @popruckyowl

I solved it by increase the GPU memory form 6g to 8g

westpilgrim avatar Jun 25 '19 06:06 westpilgrim

in opts.py line 339 i change 'default_resolution': [512,512] to [640,640] or [480,480] it can work for me but i don't know why?

zlheos avatar Jul 18 '19 06:07 zlheos

in opts.py line 339 i change 'default_resolution': [512,512] to [640,640] or [480,480] it can work for me but i don't know why?

I follow your way,it also work for me.still not figure out?

staurfan avatar Aug 19 '19 13:08 staurfan

I was getting weird out of memory errors with my dataset during testing. Exploring the dataset I found some big images (something like 4000x6000) in the dataset that caused the error. I solved it by capping the biggest border of the image to something more manageable (like 1024) at test time and maintaining the same aspect ratio.

ggsggs avatar Aug 21 '19 00:08 ggsggs

I set default resolution as 512512,all images with out of memory errors,set as 480480 or 640*640,there is no memory errors

At 2019-08-21 08:40:23, "GGS" [email protected] wrote:

I was getting weird out of memory errors with my dataset during testing. Exploring the dataset I found some big images (something like 4000x6000) in the dataset that caused the error. I solved it by capping the biggest border of the image to something more manageable (like 1024) at test time and maintaining the same aspect ratio.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

staurfan avatar Aug 23 '19 02:08 staurfan

I set default resolution as 512512,all images with out of memory errors,set as 480480 or 640*640,there is no memory errors At 2019-08-21 08:40:23, "GGS" [email protected] wrote: I was getting weird out of memory errors with my dataset during testing. Exploring the dataset I found some big images (something like 4000x6000) in the dataset that caused the error. I solved it by capping the biggest border of the image to something more manageable (like 1024) at test time and maintaining the same aspect ratio. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

@staurfan @zlheos I changed the resolution and solved this problem when I run the demo.py, but the same problem occurs when I run the main.py to train my dataset , changing the resolution is useless. Do you know how to solve it? RTX2080Ti *2 CUDA92

So-LiYatao avatar Oct 17 '19 12:10 So-LiYatao