tensorflow-onnx icon indicating copy to clipboard operation
tensorflow-onnx copied to clipboard

tf2onnx.convert has no attribute from_saved_model

Open marghoobtarar opened this issue 2 years ago • 3 comments

I am trying to convert my custom objectdetection model .pb to .onnx model here is the code snippet

import tf2onnx

# Replace with your paths
saved_model_path = '/path/to/saved_model'
onnx_export_path = '/path/to/model.onnx'

# Convert SavedModel to ONNX
tf2onnx.convert.from_saved_model(saved_model_path, output_path=onnx_export_path)

Urgency it very urgent

System information

  • OS Platform and Distribution: WINDOW
  • TensorFlow Version:2.15.1
  • Python version: 3.9.12
  • ONNX version (if applicable, e.g. 1.1.*):1.15.1
  • ONNXRuntime version (if applicable, e.g. 1.11*):1.16.2

To Reproduce I read the library tf2onnx.convert file there is no module/function with named as from_saved_model as well as from_tensorflow

Additional context my existed model is trained with SSD EfficientNet-D2 with BiFPN

marghoobtarar avatar Nov 29 '23 08:11 marghoobtarar

Please refer to here for a reference of how to use command to implement this. The parameter '--saved-model' can help you.

fatcat-z avatar Dec 07 '23 01:12 fatcat-z