SpursLipu / YOLOv3v4-ModelCompression-MultidatasetTraining-Multibackbone

YOLO ModelCompression MultidatasetTraining
GNU General Public License v3.0
445 stars 136 forks source link

Set ONNX_EXPORT=True in models.py 运行detect.py 出错 #155

Open likelyxx opened 2 years ago

likelyxx commented 2 years ago

将 model.py 的 ONNX_EXPORT设置为True,模型输入尺寸(416,416) 设置detect()函数 内 imgsz = (416, 256) if ONNX_EXPORT else opt.img_size 运行detect.py 出现如下错误: image 1/1 data\samples\84.jpg: Traceback (most recent call last): File "e:/lixx/vscode_python_project/YOLOv3v4-ModelCompression-MultidatasetTraining-Multibackbone/detect.py", line 220, in <module> detect() File "e:/lixx/vscode_python_project/YOLOv3v4-ModelCompression-MultidatasetTraining-Multibackbone/detect.py", line 114, in detect pred = model(img, augment=opt.augment)[0] File "G:\anaconda3_2019_10\envs\tensorflow-gpu\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "e:\lixx\vscode_python_project\YOLOv3v4-ModelCompression-MultidatasetTraining-Multibackbone\models.py", line 790, in forward return self.forward_once(x) File "e:\lixx\vscode_python_project\YOLOv3v4-ModelCompression-MultidatasetTraining-Multibackbone\models.py", line 850, in forward_once x = module(x) File "G:\anaconda3_2019_10\envs\tensorflow-gpu\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "G:\anaconda3_2019_10\envs\tensorflow-gpu\lib\site-packages\torch\nn\modules\upsampling.py", line 141, in forward return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners) File "G:\anaconda3_2019_10\envs\tensorflow-gpu\lib\site-packages\torch\nn\functional.py", line 3712, in interpolate return torch._C._nn.upsample_nearest2d(input, output_size, scale_factors)