Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

tf.random.shuffle supported #707

Open
chan4cc opened this issue Apr 14, 2021 · 0 comments
Open

tf.random.shuffle supported #707

chan4cc opened this issue Apr 14, 2021 · 0 comments

Comments

@chan4cc
Copy link

chan4cc commented Apr 14, 2021

I'm trying to convert a keras h5 model(create with tf1.12) to ONNX:

from tensorflow.keras.models import load_model

model = load_model(my_model_file)

onnx_model = keras2onnx.convert_keras(model, model.name)
onnx_model.save_model('model.onnx')

which report a error like:

WARN: No corresponding ONNX op matches the tf.op node cos_sim/RandomShuffle_6 of type RandomShuffle
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node cos_sim/RandomShuffle_5 of type RandomShuffle
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node cos_sim/RandomShuffle_4 of type RandomShuffle
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node cos_sim/RandomShuffle_3 of type RandomShuffle
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node cos_sim/RandomShuffle_2 of type RandomShuffle
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node cos_sim/RandomShuffle_1 of type RandomShuffle
      The generated ONNX model needs run with the custom op supports.
WARN: No corresponding ONNX op matches the tf.op node cos_sim/RandomShuffle of type RandomShuffle
      The generated ONNX model needs run with the custom op supports.
There is an error(<class 'StopIteration'>) happened during optimizing on the converted model!

I tried pass param custom_op_conversions with {'RandomShuffle': tf.random.shuffle}, and it report the same error. it seems that keras2onnx not support op tf.random.shuffle yet?

Version Used:
tensorflow: 1.12
onnxconverter-common: 1.8.1
keras2onnx: 1.8.0

@chan4cc chan4cc closed this as completed Apr 26, 2021
@chan4cc chan4cc reopened this Apr 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant