You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.
I am trying to accelerate a NLP pipeline using keras-onnx. The Keras model consisting a CRF layer (tf2crf) on top of the BiLSTM layer. I faced a following error: ValueError: Unable to find out a correct type for tensor type = <dtype: 'variant'> of sequential/crf/scan/while/exit/_103:0
I would appreciate it if you could direct me how to run the model via keras_onnx
def build_model():
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Bidirectional(tf.keras.layers.LSTM(internal_unit, return_sequences=True), input_shape=(seq_length, vector_dim)))
if drop_out_rate >0 and drop_out_rate <1:
model.add(tf.keras.layers.Dropout(drop_out_rate))
model.add(tf.keras.layers.TimeDistributed(tf.keras.layers.Dense(num_tags, activation=activation)))
crf = CRF(num_tags)
model.add(crf)
model.compile (loss=crf.loss, metrics=[crf.accuracy], optimizer=model_optimizer)
return model
model = build_model()
model.load_weights("model.h5")
onnx_model = keras2onnx.convert_keras(model, model.name)
The output is: ValueError: Unable to find out a correct type for tensor type = <dtype: 'variant'> of sequential_1/crf_1/scan/while/exit/_103:0
Hi,
I am trying to accelerate a NLP pipeline using keras-onnx. The Keras model consisting a CRF layer (tf2crf) on top of the BiLSTM layer. I faced a following error: ValueError: Unable to find out a correct type for tensor type = <dtype: 'variant'> of sequential/crf/scan/while/exit/_103:0
I would appreciate it if you could direct me how to run the model via keras_onnx
The output is:
ValueError: Unable to find out a correct type for tensor type = <dtype: 'variant'> of sequential_1/crf_1/scan/while/exit/_103:0
Is it an onnx error or am I missing something?
Versions:
Python: 3.7.10
Tensorflow: 2.3.0
Keras: 2.2.4
tf2crf: 0.1.13
Thanks!
The text was updated successfully, but these errors were encountered: