YOLOv5_PyTorch_cpp icon indicating copy to clipboard operation
YOLOv5_PyTorch_cpp copied to clipboard

模型导出

Open zenith779 opened this issue 5 years ago • 2 comments

请问在导出gpu版本的模型的时候,设置的model.model[-1].export = False吗?

zenith779 avatar Dec 18 '20 06:12 zenith779

Yes, I set model.model[-1].export = False when exporting TorchScript model (in both CPU and GPU).

Reference: https://github.com/yasenh/libtorch-yolov5#torchscript-model-export

hotsuyuki avatar Dec 18 '20 12:12 hotsuyuki

Yes, I set model.model[-1].export = False when exporting TorchScript model (in both CPU and GPU).

Reference: https://github.com/yasenh/libtorch-yolov5#torchscript-model-export

But, when i set model.model[-1].export = False, this get TracerWarning: Converting a ce to be incorrect. We can't record the data flow of Python values, so this value will eans that the trace might not generalize to other inputs! if self.grid[i].shape[2:4] != x[i].shape[2:4]:, does this affect libtorch load torchscript model?

zenith779 avatar Dec 18 '20 12:12 zenith779