2

I am using kaggle notebook. I am trying to convert my pytorch model into tensorflow model to run with tensorflowJS. I used below code to convert onnx model to tensorflow model-

import onnx
from onnx_tf.backend import prepare
 
onnx_model = onnx.load("../input/onnx-model/model.onnx")
tf_rep = prepare(onnx_model)
tf_rep.export_graph("output/model.pb")

I got

SchemaError: No schema registered for 'BitShift'!

I tried with onnx version 1.8.1 , 1.8.0 and then further downgrade to 1.6.0 .

Also, I tried to run onnx model directly with onnx.js but facing issue in image normalization and resizing. Hence, I decided to switch to tfjs.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
ameya
  • 201
  • 2
  • 16

2 Answers2

2

I faced the same issue. Uninstall the onnx-tf and run pip install git+https://github.com/onnx/onnx-tensorflow.git. Issue seems to be with some exception type.

Amith Lakkakula
  • 506
  • 3
  • 8
0

I have tested it for tf-1.15.0, and downgrading onnx by pip install onnx==1.8.0
For more details use this answer

Prajot Kuvalekar
  • 5,128
  • 3
  • 21
  • 32