OpKernel was registered to support Op 'PyFunc' with these attrs

tensorflow1.14   onnx-tf 1.5.0  onnx 1.5.0

pytorch->onnx->tensorflow ,加載pb模型的時候出現如下錯誤 

Invalid argument: No OpKernel was registered to support Op 'PyFunc' with these attrs.  Registered devices: [CPU], Registered kernels:
  <no registered kernels>

 [[Node: PyFunc = PyFunc[Tin=[DT_FLOAT, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_INT32, DT_STRING], Tout=[DT_FLOAT], token="pyfunc_0"](Relu, PyFunc/input_1, PyFunc/input_2, PyFunc/input_3, PyFunc/input_4, PyFunc/input_5, PyFunc/input_6)]]

 

參考https://github.com/onnx/onnx-tensorflow/issues/167                                                                                                                   

from onnx_tf.backend import prepare
model = onnx.load("duc_se.onnx")
tf_rep = prepare(model, strict=False)

測試alphapose的.pd模型和pytorch的結果是一致的

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章