【アルゴリズム】CenterNet実行demo時報エラー:RuntimeError:CUDA error:out of memory


問題の説明
python demo.py ctdet --demo /home/vincent/Code/CenterNet-master/images/ --load_model /home/vincent/Code/CenterNet-master/models/ctdet_coco_dla_2x.pth 

上のdemoコードで実行中に次のエラーが発生しました(ファイルアドレスをあなたのアドレスに変更することに注意してください)
Fix size testing.
training chunk_sizes: [32]
The output will be saved to  /home/vincent/Code/CenterNet-master/src/lib/../../exp/ctdet/default
heads {'hm': 80, 'wh': 2, 'reg': 2}
Creating model...
loaded /home/vincent/Code/CenterNet-master/models/ctdet_coco_dla_2x.pth, epoch 230
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1535491974311/work/aten/src/THC/THCGeneral.cpp line=663 error=11 : invalid argument
Traceback (most recent call last):
  File "demo.py", line 56, in <module>
    demo(opt)
  File "demo.py", line 49, in demo
    ret = detector.run(image_name)
  File "/home/vincent/Code/CenterNet-master/src/lib/detectors/base_detector.py", line 116, in run
    output, dets, forward_time = self.process(images, return_time=True)
  File "/home/vincent/Code/CenterNet-master/src/lib/detectors/ctdet.py", line 30, in process
    output = self.model(images)[-1]
  File "/home/vincent/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/vincent/Code/CenterNet-master/src/lib/models/networks/pose_dla_dcn.py", line 481, in forward
    z[head] = self.__getattr__(head)(y[-1])
  File "/home/vincent/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/vincent/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/container.py", line 91, in forward
    input = module(input)
  File "/home/vincent/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/vincent/anaconda3/envs/CenterNet/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 301, in forward
    self.padding, self.dilation, self.groups)
RuntimeError: CUDA error: out of memory

解決策demo.pyに次の内容を加えます.
import torch
torch.backends.cudnn.enabled = False

参照:cuda out of memory#184