Skip to content

[Bug]: Convert to OpenVINO IR - Tensorflow sample code error #30056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
bonihaniboni opened this issue Apr 10, 2025 · 2 comments · Fixed by #30096
Closed
3 tasks done

[Bug]: Convert to OpenVINO IR - Tensorflow sample code error #30056

bonihaniboni opened this issue Apr 10, 2025 · 2 comments · Fixed by #30096
Assignees
Labels
bug Something isn't working category: TF FE OpenVINO TensorFlow FrontEnd support_request

Comments

@bonihaniboni
Copy link

OpenVINO Version

202.0

Operating System

Windows System

Device used for inference

CPU

Framework

None

Model used

ResNet50

Issue description

When i try to use sample code

Run once

import openvino as ov
import tensorflow as tf

1. Convert model created with TF code

model = tf.keras.applications.resnet50.ResNet50(weights="imagenet")
ov_model = ov.convert_model(model)

2. Save model as OpenVINO IR

ov.save_model(ov_model, 'model.xml', compress_to_fp16=True) # enabled by default

Repeat as needed

import openvino as ov

3. Load model from file

core = ov.Core()
ov_model = core.read_model("model.xml")

4. Compile model from memory

compiled_model = ov.compile_model(ov_model)

but errors occurs
ValueError: Missing data for input "input_layer". You passed a data dictionary with keys ['keras_tensor']. Expected the following keys: ['input_layer']

Step-by-step reproduction

Run code below

Run once

import openvino as ov
import tensorflow as tf

1. Convert model created with TF code

model = tf.keras.applications.resnet50.ResNet50(weights="imagenet")
ov_model = ov.convert_model(model)

2. Save model as OpenVINO IR

ov.save_model(ov_model, 'model.xml', compress_to_fp16=True) # enabled by default

Repeat as needed

import openvino as ov

3. Load model from file

core = ov.Core()
ov_model = core.read_model("model.xml")

4. Compile model from memory

compiled_model = ov.compile_model(ov_model)

Relevant log output

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.
@bonihaniboni bonihaniboni added bug Something isn't working support_request labels Apr 10, 2025
@ilya-lavrenov ilya-lavrenov added the category: TF FE OpenVINO TensorFlow FrontEnd label Apr 10, 2025
@rkazants
Copy link
Member

@bonihaniboni, thanks for this great catch.

Fix: #30096

Best regards,
Roman

@bonihaniboni
Copy link
Author

Thanks for Intel Team's help

github-merge-queue bot pushed a commit that referenced this issue Apr 14, 2025
…30096)

**Details:** Correct input names for TF Keras model converted from
memory.

**Ticket:** #30056

---------

Signed-off-by: Kazantsev, Roman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working category: TF FE OpenVINO TensorFlow FrontEnd support_request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants