RuntimeError: Input, output and indices must be on the current device


Traceback (most recent call last):
  File "detect.py", line 236, in <module>
    detect()
  File "detect.py", line 47, in detect
    torch.onnx.export(model,               # model being run
  File "/home/zjkj/miniconda3/envs/yolov5/lib/python3.8/site-packages/torch/onnx/__init__.py", line 271, in export
    return utils.export(model, args, f, export_params, verbose, training,
  File "/home/zjkj/miniconda3/envs/yolov5/lib/python3.8/site-packages/torch/onnx/utils.py", line 88, in export
    _export(model, args, f, export_params, verbose, training, input_names, output_names,
  File "/home/zjkj/miniconda3/envs/yolov5/lib/python3.8/site-packages/torch/onnx/utils.py", line 694, in _export
    _model_to_graph(model, args, verbose, input_names,
  File "/home/zjkj/miniconda3/envs/yolov5/lib/python3.8/site-packages/torch/onnx/utils.py", line 502, in _model_to_graph
    params_dict = torch._C._jit_pass_onnx_constant_fold(graph, params_dict,
RuntimeError: Input, output and indices must be on the current device

 

上一篇:RuntimeError: CUDA out of memory.


下一篇:checkpoint = torch.load(args.state_dict) ->RuntimeError: CUDA error: out of memory