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

Issue loading onnx model after conversion

Open carl-krikorian opened this issue 1 year ago • 1 comments

Describe the bug

saved_model.zip

I am currently trying to convert and run inference on the attached model, it was made using tensorflow 1 and at first the conversion seems to go well with the following output:

2023-06-28 13:52:30,327 - INFO - Using tensorflow=1.15.5, onnx=1.14.0, tf2onnx=1.14.0/8f8d49
2023-06-28 13:52:30,327 - INFO - Using opset <onnx, 18>
2023-06-28 13:52:31,043 - INFO - Computed 277 values for constant folding
2023-06-28 13:52:31,206 - INFO - folding node using tf type=Cast, name=truediv/Cast
2023-06-28 13:52:31,206 - INFO - folding node using tf type=Cast, name=truediv_1/Cast
2023-06-28 13:52:31,206 - INFO - folding node using tf type=Reshape, name=Reshape
2023-06-28 13:52:31,207 - INFO - folding node using tf type=LogicalOr, name=pad_to_bounding_box/LogicalOr
2023-06-28 13:52:31,207 - INFO - folding node using tf type=Identity, name=MobilenetV2/Conv/weights/read
2023-06-28 13:52:31,207 - INFO - folding node using tf type=Identity, name=MobilenetV2/Conv/BatchNorm/gamma/read
2023-06-28 13:52:31,207 - INFO - folding node using tf type=Identity, name=MobilenetV2/Conv/BatchNorm/beta/read
2023-06-28 13:52:31,207 - INFO - folding node using tf type=Identity, name=MobilenetV2/Conv/BatchNorm/moving_mean/read
2023-06-28 13:52:31,207 - INFO - folding node using tf type=Identity, name=MobilenetV2/Conv/BatchNorm/moving_variance/read
2023-06-28 13:52:31,207 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/depthwise/depthwise_weights/read
2023-06-28 13:52:31,207 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,207 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,208 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,208 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,208 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/project/weights/read
2023-06-28 13:52:31,208 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/project/BatchNorm/gamma/read
2023-06-28 13:52:31,208 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/project/BatchNorm/beta/read
2023-06-28 13:52:31,208 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,208 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,208 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/expand/weights/read
2023-06-28 13:52:31,209 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,209 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/expand/BatchNorm/beta/read
2023-06-28 13:52:31,209 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,209 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,209 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/depthwise/depthwise_weights/read
2023-06-28 13:52:31,209 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,210 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,210 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,210 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,210 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/project/weights/read
2023-06-28 13:52:31,210 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/project/BatchNorm/gamma/read
2023-06-28 13:52:31,210 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/project/BatchNorm/beta/read
2023-06-28 13:52:31,210 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,210 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_1/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,210 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/expand/weights/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/expand/BatchNorm/beta/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/depthwise/depthwise_weights/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,211 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/project/weights/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/project/BatchNorm/gamma/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/project/BatchNorm/beta/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_2/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/expand/weights/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/expand/BatchNorm/beta/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/depthwise/depthwise_weights/read
2023-06-28 13:52:31,212 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/project/weights/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/project/BatchNorm/gamma/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/project/BatchNorm/beta/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_3/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/expand/weights/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,213 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/expand/BatchNorm/beta/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/depthwise/depthwise_weights/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/project/weights/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/project/BatchNorm/gamma/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/project/BatchNorm/beta/read
2023-06-28 13:52:31,214 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_4/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/expand/weights/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/expand/BatchNorm/beta/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/depthwise/depthwise_weights/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,215 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/project/weights/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/project/BatchNorm/gamma/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/project/BatchNorm/beta/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_5/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/expand/weights/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/expand/BatchNorm/beta/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,216 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/depthwise/depthwise_weights/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/project/weights/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/project/BatchNorm/gamma/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/project/BatchNorm/beta/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_6/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/expand/weights/read
2023-06-28 13:52:31,217 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/expand/BatchNorm/beta/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/depthwise/depthwise_weights/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/project/weights/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/project/BatchNorm/gamma/read
2023-06-28 13:52:31,218 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/project/BatchNorm/beta/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_7/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/expand/weights/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/expand/BatchNorm/beta/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/depthwise/depthwise_weights/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,219 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/project/weights/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/project/BatchNorm/gamma/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/project/BatchNorm/beta/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_8/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/expand/weights/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/expand/BatchNorm/beta/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,220 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/depthwise/depthwise_weights/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/project/weights/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/project/BatchNorm/gamma/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/project/BatchNorm/beta/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_9/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,221 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/expand/weights/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/expand/BatchNorm/beta/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/depthwise/depthwise_weights/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/depthwise/BatchNorm/moving_mean/read

2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/project/weights/read
2023-06-28 13:52:31,222 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/project/BatchNorm/gamma/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/project/BatchNorm/beta/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_10/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/expand/weights/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/expand/BatchNorm/beta/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/depthwise/depthwise_weights/read
2023-06-28 13:52:31,223 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/project/weights/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/project/BatchNorm/gamma/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/project/BatchNorm/beta/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_11/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/expand/weights/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,224 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/expand/BatchNorm/beta/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/depthwise/depthwise_weights/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/project/weights/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/project/BatchNorm/gamma/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/project/BatchNorm/beta/read
2023-06-28 13:52:31,225 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_12/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/expand/weights/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/expand/BatchNorm/beta/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/depthwise/depthwise_weights/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,226 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/project/weights/read
2023-06-28 13:52:31,227 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/project/BatchNorm/gamma/read
2023-06-28 13:52:31,227 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/project/BatchNorm/beta/read
2023-06-28 13:52:31,227 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,227 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_13/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,227 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/expand/weights/read
2023-06-28 13:52:31,227 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,227 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/expand/BatchNorm/beta/read
2023-06-28 13:52:31,227 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/depthwise/depthwise_weights/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/project/weights/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/project/BatchNorm/gamma/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/project/BatchNorm/beta/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,228 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_14/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/expand/weights/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/expand/BatchNorm/beta/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/depthwise/depthwise_weights/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,229 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/project/weights/read
2023-06-28 13:52:31,230 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/project/BatchNorm/gamma/read
2023-06-28 13:52:31,230 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/project/BatchNorm/beta/read
2023-06-28 13:52:31,230 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,230 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_15/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,230 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/expand/weights/read
2023-06-28 13:52:31,230 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/expand/BatchNorm/gamma/read
2023-06-28 13:52:31,230 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/expand/BatchNorm/beta/read
2023-06-28 13:52:31,230 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/expand/BatchNorm/moving_mean/read
2023-06-28 13:52:31,230 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/expand/BatchNorm/moving_variance/read
2023-06-28 13:52:31,231 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/depthwise/depthwise_weights/read
2023-06-28 13:52:31,231 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/depthwise/BatchNorm/gamma/read
2023-06-28 13:52:31,231 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/depthwise/BatchNorm/beta/read
2023-06-28 13:52:31,231 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/depthwise/BatchNorm/moving_mean/read
2023-06-28 13:52:31,231 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/depthwise/BatchNorm/moving_variance/read
2023-06-28 13:52:31,231 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/project/weights/read
2023-06-28 13:52:31,231 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/project/BatchNorm/gamma/read
2023-06-28 13:52:31,231 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/project/BatchNorm/beta/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/project/BatchNorm/moving_mean/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=MobilenetV2/expanded_conv_16/project/BatchNorm/moving_variance/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=image_pooling/weights/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=image_pooling/BatchNorm/gamma/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=image_pooling/BatchNorm/beta/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=image_pooling/BatchNorm/moving_mean/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=image_pooling/BatchNorm/moving_variance/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=aspp0/weights/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=aspp0/BatchNorm/gamma/read
2023-06-28 13:52:31,232 - INFO - folding node using tf type=Identity, name=aspp0/BatchNorm/beta/read
2023-06-28 13:52:31,233 - INFO - folding node using tf type=Identity, name=aspp0/BatchNorm/moving_mean/read
2023-06-28 13:52:31,233 - INFO - folding node using tf type=Identity, name=aspp0/BatchNorm/moving_variance/read
2023-06-28 13:52:31,233 - INFO - folding node using tf type=Identity, name=concat_projection/weights/read
2023-06-28 13:52:31,233 - INFO - folding node using tf type=Identity, name=concat_projection/BatchNorm/gamma/read
2023-06-28 13:52:31,233 - INFO - folding node using tf type=Identity, name=concat_projection/BatchNorm/beta/read
2023-06-28 13:52:31,233 - INFO - folding node using tf type=Identity, name=concat_projection/BatchNorm/moving_mean/read
2023-06-28 13:52:31,233 - INFO - folding node using tf type=Identity, name=concat_projection/BatchNorm/moving_variance/read
2023-06-28 13:52:31,233 - INFO - folding node using tf type=Identity, name=logits/semantic/weights/read
2023-06-28 13:52:31,234 - INFO - folding node using tf type=Identity, name=logits/semantic/biases/read
2023-06-28 13:52:31,234 - INFO - folding node using tf type=StridedSlice, name=strided_slice_8
2023-06-28 13:52:31,469 - INFO - Optimizing ONNX model
2023-06-28 13:52:32,823 - INFO - After optimization: BatchNormalization -47 (54->7), Cast -7 (20->13), Const -336 (493->157), Identity -88 (88->0), Reshape -20 (22->2), Shape -1 (6->5), Slice -2 (13->11), Squeeze -7 (16->9), Transpose -244 (248->4), Unsqueeze -7 (17->10)
2023-06-28 13:52:32,852 - INFO - 
2023-06-28 13:52:32,852 - INFO - Successfully converted TensorFlow model ./tfmodels/card_mask/saved_model/ to ONNX
2023-06-28 13:52:32,852 - INFO - Model inputs: ['inputs']
2023-06-28 13:52:32,852 - INFO - Model outputs: ['segmentation_map']
2023-06-28 13:52:32,852 - INFO - ONNX model is saved at ./output_models/onnx/card_mask/model.onnx

However, before trying to run inference the following line sess = rt.InferenceSession(output_model_path) fails with an error :

[ONNXRuntimeError] : 1 : FAIL : Load model from ./output_models/onnx/card_mask/model.onnx failed:Type Error: Type parameter (T) of Optype (Sub) bound to different types (tensor(uint8) and tensor(float) in node (pad_to_bounding_box/sub)

I have tried using various opsets and tensorflow versions and tweaking the various arguments. I've used the saved_model_cli to deduce the tags and it has the following output:

MetaGraphDef with tag-set: 'serve' contains the following SignatureDefs:

signature_def['detection_signature']:
  The given SavedModel SignatureDef contains the following input(s):
    inputs['inputs'] tensor_info:
        dtype: DT_UINT8
        shape: (1, -1, -1, 3)
        name: Placeholder:0
  The given SavedModel SignatureDef contains the following output(s):
    outputs['segmentation_map'] tensor_info:
        dtype: DT_INT64
        shape: (1, -1, -1)
        name: Identity:0
  Method name is: tensorflow/serving/predict
The MetaGraph with tag set ['serve'] contains the following ops: {'Shape', 'Placeholder', 'ArgMax', 'Relu6', 'ResizeBilinear', 'ExpandDims', 'TruncatedNormal', 'RandomUniform', 'MergeV2Checkpoints', 'Slice', 'Pad', 'Squeeze', 'Assert', 'BiasAdd', 'Softmax', 'LogicalAnd', 'Pack', 'SpaceToBatchND', 'Maximum', 'Reshape', 'GreaterEqual', 'RealDiv', 'Unpack', 'VariableV2', 'Conv2D', 'BatchToSpaceND', 'ShardedFilename', 'Identity', 'RestoreV2', 'SaveV2', 'DepthwiseConv2dNative', 'AddV2', 'Relu', 'Mul', 'NoOp', 'Floor', 'FusedBatchNormV3', 'LogicalOr', 'StringJoin', 'ResizeNearestNeighbor', 'Const', 'Sub', 'AvgPool', 'Equal', 'PlaceholderWithDefault', 'Cast', 'ConcatV2', 'Assign', 'Minimum', 'StridedSlice', 'L2Loss', 'Add'}

I'm not sure if I'm doing something wrong if so please let me know but I have opened this issue on this repo as I have seen this error may be related to the model conversion rather than the loading as shown here: 
- https://github.com/microsoft/onnxruntime/issues/1764
Please advise and thank you for your time.

Urgency

None System information

  • OS Platform and Distribution: Linux Ubuntu 22.04
  • TensorFlow Version: 2.8.2 and 1.15.5
  • Python version: 3.7.11 (default, Jul 27 2021, 14:32:16)
  • ONNX version: 1.13.1 and 1.14.0
  • ONNXRuntime version: 1.14.1

To Reproduce

I used this command with the attached saved Model, let me know if further information is required

card_mask_model_path = "./tfmodels/card_mask/saved_model/"
output_model_path = "./output_models/onnx/card_mask/model.onnx"
model_signature = "detection_signature"
model_tag = "serve"
environ["MASK_PATH"] = card_mask_model_path
environ["MASK_SIGNATURE"] = model_signature
environ["MASK_TAG"] = model_tag
environ["OUTPUT_PATH"] = output_model_path
!python3 -m tf2onnx.convert --saved-model $MASK_PATH --output $OUTPUT_PATH  --tag $MASK_TAG --signature_def $MASK_SIGNATURE --opset 18

Screenshots

Additional context

carl-krikorian avatar Jun 28 '23 11:06 carl-krikorian

@carl-krikorian, as per the below reference, the Resize Operator does not allow INT64 as input type. https://github.com/microsoft/onnxruntime/blob/master/docs/OperatorKernels.md.

Therefore, one possible solution is to add the following logic at the end of the ResizeBilinear logic as a workaround for the type restrictions https://github.com/onnx/tensorflow-onnx/blob/main/tf2onnx/onnx_opset/nn.py#L1445

        origin_dtype = ctx.get_dtype(resize.output[0])
        if origin_dtype not in [onnx_pb.TensorProto.FLOAT, onnx_pb.TensorProto.INT32]:
            cast_node = ctx.insert_new_node_on_input(resize, "Cast", resize.input[0])
            cast_node.set_attr("to", onnx_pb.TensorProto.FLOAT)
            ctx.set_dtype(cast_node.output[0], onnx_pb.TensorProto.FLOAT)
            ctx.copy_shape(resize.name, cast_node.output[0])

            cast_back_node = ctx.insert_new_node_on_output("Cast", resize.output[0],
                                                           name=utils.make_name(resize.name) + "_castback")
            cast_back_node.set_attr("to", origin_dtype)
            ctx.set_dtype(cast_back_node.output[0], origin_dtype)
            ctx.copy_shape(resize.name, cast_back_node.output[0])

dalia-jaber avatar Nov 29 '23 08:11 dalia-jaber