Assertion failed: cond.is_weights() && cond.weights().count() == 1 && “If condition must be a initia

用onnx–>trt文件时,出现错误:Assertion failed: cond.is_weights() && cond.weights().count() == 1 && "If condition must be a initia
将生成的onnx文件用netron(https://netron.app/)打开,
原因出在这:if语句
Assertion failed: cond.is_weights() && cond.weights().count() == 1 && “If condition must be a initia_第1张图片
解决办法:实例化网络(pth–onnx)的时候把if语句去掉,找squeeze(1)操作删掉,重新生成onnx即可

你可能感兴趣的:(平时学习总结,语音识别)