diff --git a/models/onnx_export.py b/models/onnx_export.py index a7132de8465..fd8abeb6365 100644 --- a/models/onnx_export.py +++ b/models/onnx_export.py @@ -25,7 +25,7 @@ # Load pytorch model google_utils.attempt_download(opt.weights) - model = torch.load(opt.weights)['model'] + model = torch.load(opt.weights, map_location=torch.device('cpu'))['model'] model.eval() model.fuse()