Pytorch转ONNX报错-Cannot insert a Tensor that requires grad as a constant

Yunfeng's Simple Blog Yunfeng's Simple Blog ·

pytorch模型转换onnx的时候,遇到了下面的报错信息: 1RuntimeError: Cannot insert a Tensor that requires grad as a constant. Consider making it a parameter or input, or detaching the gradient...

阅读原文