Tengine icon indicating copy to clipboard operation
Tengine copied to clipboard

pth转onnx转换tmfile模型,模型是双头网络,最后一层激活层必须保持一致,是bug吧

Open BrilliantSunshine-h opened this issue 3 years ago • 1 comments

很像一个玄学bug,自己训练的模型pth转onnx再转tmfile时,发现报错“Segmentation fault (core dumped)”, 于是先搭了个两层卷积的模型,成功“Create tengine model file done: hxq4.tmfile”, 一步步增减网络,最终定位问题,模型是双头的,有两个输出,我之前设置一个输出激活用的sigmoid,另一个relu,就会报错, 如果两个激活都是sigmoid或者都是relu,成功, 如果把sigmoid和relu对调,报错“free(): invalid pointer Aborted (core dumped)” 虽然问题解决了但是我依然觉得很神奇。

BrilliantSunshine-h avatar Dec 15 '22 03:12 BrilliantSunshine-h

我的解决方案是把两个头的输出cat在一起,变成一个输出,然后就正常了。。

BrilliantSunshine-h avatar Dec 30 '22 01:12 BrilliantSunshine-h