Skip to content

ERROR:tf2onnx.tfonnx:Tensorflow op [sequential_1/bidirectional_1/forward_lstm_1/CudnnRNNV3: CudnnRNNV3] is not supported #21799

@josephgiting

Description

@josephgiting

Open this issue following the discussion from #21533 (comment)

Export the following model using:

keras==3.12.0
tf2onnx-1.16.1
onnx-1.19.1
protobuf-3.20.3
tensorflow==2.19.0

  model = Sequential()
  model.add(Input(shape=(sam_sz, num_features_in))) # Use calculated input shape
  for _ in range(conv_lay):
    model.add(Conv1D(filters=filter, kernel_size=ker_size, activation=act, padding='same', data_format='channels_last'))
    model.add(MaxPooling1D(pool_size=pool_size, data_format='channels_last'))
  for _ in range(lstm_lay):
    # For intermediate LSTM layers, return sequences
    model.add(Bidirectional(LSTM(100, return_sequences = True, kernel_regularizer=l2(0.0001)))) # Use Bidirectional LSTM
    model.add(Dropout(0.3))
  model.add(Bidirectional(LSTM(100, return_sequences = False, kernel_regularizer=l2(0.0001)))) # Use Bidirectional LSTM
  model.add(Dropout(0.3))
  model.add(Dense(units=3, activation = act2, kernel_regularizer=l2(0.0001)))

with:
model.export(output_path, format="onnx")

observed the following issues:

WARNING:tf2onnx.shape_inference:Cannot infer shape for sequential_1/bidirectional_1/forward_lstm_1/CudnnRNNV3: sequential_1/bidirectional_1/forward_lstm_1/CudnnRNNV3:3,sequential_1/bidirectional_1/forward_lstm_1/CudnnRNNV3:4
WARNING:tf2onnx.shape_inference:Cannot infer shape for sequential_1/bidirectional_1/backward_lstm_1/CudnnRNNV3: sequential_1/bidirectional_1/backward_lstm_1/CudnnRNNV3:3,sequential_1/bidirectional_1/backward_lstm_1/CudnnRNNV3:4
ERROR:tf2onnx.tfonnx:Tensorflow op [sequential_1/bidirectional_1/forward_lstm_1/CudnnRNNV3: CudnnRNNV3] is not supported
ERROR:tf2onnx.tfonnx:Tensorflow op [sequential_1/bidirectional_1/backward_lstm_1/CudnnRNNV3: CudnnRNNV3] is not supported
ERROR:tf2onnx.tfonnx:Unsupported ops: Counter({'CudnnRNNV3': 2})

Would appreciate your attention.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions