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
OpenVINO crashed when the given Keras model containing UpSampling2D layer was converted to OpenVINO IR.
The crash happened at a type checking and threw "Input element type must be f32, f16, bf16, i8, u8, i64, i32". The check may skip the type of i16.
Step-by-step reproduction
import tensorflow as tf
from tensorflow import keras as keras
from tensorflow.keras import layers, models
import numpy as np
import openvino as ov
layer = keras.layers.UpSampling2D()
input_shape = [1, 2, 3, 4]
input_data = np.random.randint(0, 1, size=input_shape)
weights = layer.get_weights()
layer.set_weights(weights)
x = layers.Input(shape=input_shape[1:], dtype="int16")
y = layer(x)
model = models.Model(x, y)
model.summary()
res_keras = model(input_data)
tf.saved_model.save(model, "tf_model")
ov_model = ov.convert_model("tf_model", input=input_shape)
Relevant log output
Traceback (most recent call last):
File "/home/shenqingchao/opera/OPERA/keras/fuzz/ov-bugs/bug3.py", line 19, in<module>
ov_model = ov.convert_model("tf_model", input=input_shape)
File "/home/shenqingchao/.conda/envs/ov-latest/lib/python3.9/site-packages/openvino/tools/ovc/convert.py", line 101, in convert_model
ov_model, _ = _convert(cli_parser, params, True)
File "/home/shenqingchao/.conda/envs/ov-latest/lib/python3.9/site-packages/openvino/tools/ovc/convert_impl.py", line 535, in _convert
raise e
File "/home/shenqingchao/.conda/envs/ov-latest/lib/python3.9/site-packages/openvino/tools/ovc/convert_impl.py", line 478, in _convert
ov_model = driver(argv, {"conversion_parameters": non_default_params})
File "/home/shenqingchao/.conda/envs/ov-latest/lib/python3.9/site-packages/openvino/tools/ovc/convert_impl.py", line 230, in driver
ov_model = moc_emit_ir(prepare_ir(argv), argv)
File "/home/shenqingchao/.conda/envs/ov-latest/lib/python3.9/site-packages/openvino/tools/ovc/convert_impl.py", line 180, in prepare_ir
ov_model = moc_pipeline(argv, moc_front_end)
File "/home/shenqingchao/.conda/envs/ov-latest/lib/python3.9/site-packages/openvino/tools/ovc/moc_frontend/pipeline.py", line 247, in moc_pipeline
ov_model = moc_front_end.convert(input_model)
File "/home/shenqingchao/.conda/envs/ov-latest/lib/python3.9/site-packages/openvino/frontend/frontend.py", line 18, in convert
converted_model = super().convert(model)
openvino._pyopenvino.OpConversionFailure: Check 'is_conversion_successful' failed at src/frontends/tensorflow/src/frontend.cpp:415:
FrontEnd API failed with OpConversionFailure:
[TensorFlow Frontend] Internal error, conversion is failed for ResizeNearestNeighbor operation with a message:
Check 'input_et == element::f32 || input_et == element::f16 || input_et == element::i8 || input_et == element::bf16 || input_et == element::u8 || input_et == element::i64 || input_et == element::i32 || input_et == element::dynamic' failed at src/core/src/op/util/interpolate_base.cpp:57:
While validating node 'opset11::Interpolate Interpolate_8 (input_1[0]:i16[1,2,3,4], model/up_sampling2d/mul[0]:i32[2], Constant_7[0]:i32[2]) -> (dynamic[...])' with friendly_name 'Interpolate_8':
Input element type must be f32, f16, bf16, i8, u8, i64, i32
Issue submission checklist
I'm reporting an issue. It's not a question.
I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.
There is reproducer code and related data files such as images, videos, models, etc.
The text was updated successfully, but these errors were encountered:
jikechao
changed the title
[Bug]: UpSampling2D crash when input type as int16
[Bug]: Keras UpSampling2D conversion crashed when input type as int16
Nov 2, 2023
Hi @jikechao, thanks for reporting this bug. Indeed, the current loader for UpSampling2D supports limited set of input types. I will extended it to support i16 as well.
OpenVINO Version
openvino-nightly 2023.2.0.dev20231101
Operating System
Ubuntu 18.04 (LTS)
Device used for inference
BATCH
Framework
Keras (TensorFlow 2)
Model used
self defined model shown in the following script
Issue description
OpenVINO crashed when the given Keras model containing
UpSampling2D
layer was converted to OpenVINO IR.The crash happened at a type checking and threw "Input element type must be f32, f16, bf16, i8, u8, i64, i32". The check may skip the type of
i16
.Step-by-step reproduction
Relevant log output
Issue submission checklist
The text was updated successfully, but these errors were encountered: