openvino: [Good First Issue][TF FE]: Fix (AttributeError) NoneType object has no attribute shape or dtype

Context

OpenVINO component responsible for support of TensorFlow models is called as TensorFlow Frontend (TF FE). TF FE converts a model represented in TensorFlow opset to a model in OpenVINO opset.

We have 14 models from TensorFlow Hub that are failing due to issue AttributeError: NoneType object has no attribute shape or dtype. Your fix greatly helps to make OpenVINO better.

What needs to be done?

The task is to fix a problem AttributeError: NoneType object has no attribute shape or dtype.

How to reproduce the issue:

  1. Build OpenVINO following How to Build OpenVINO document
  2. Install built openvino-*.whl package using pip. You can find the package in openvino/build/wheels directory. Do not install openvino-dev-*.whl package. Also, it is recommended to use new virtual environment to avoid mess with previously installed OV packages in the system.
  3. Run the model conversion as follows:
import tensorflow_hub as hub
import openvino as ov

model_link = 'https://www.kaggle.com/models/google/gnews-swivel/frameworks/tensorFlow2/variations/tf2-preview-20dim/versions/1'
model = hub.load(model_link)

ov.convert_model(model)

Received error message:

  File "<stdin>", line 1, in <module>
  File "openvino/tools/ovc/convert.py", line 101, in convert_model
    ov_model, _ = _convert(cli_parser, params, True)
  File "openvino/tools/ovc/convert_impl.py", line 534, in _convert
    raise e
  File "openvino/tools/ovc/convert_impl.py", line 476, in _convert
    ov_model = driver(argv, {"conversion_parameters": non_default_params})
  File "openvino/tools/ovc/convert_impl.py", line 227, in driver
    ov_model = moc_emit_ir(prepare_ir(argv), argv)
  File "openvino/tools/ovc/convert_impl.py", line 177, in prepare_ir
    ov_model = moc_pipeline(argv, moc_front_end)
  File "openvino/tools/ovc/moc_frontend/pipeline.py", line 64, in moc_pipeline
    input_model = moc_front_end.load(argv.input_model, share_weights)
RuntimeError: Check 'false' failed at src/frontends/common/src/frontend.cpp:47:
Loading input model
AttributeError: 'NoneType' object has no attribute 'dtype'

At:
  openvino/frontend/tensorflow/node_decoder.py(149): get_attribute
  openvino/tools/ovc/moc_frontend/pipeline.py(64): moc_pipeline
  openvino/tools/ovc/convert_impl.py(177): prepare_ir
  openvino/tools/ovc/convert_impl.py(227): driver
  openvino/tools/ovc/convert_impl.py(476): _convert
  openvino/tools/ovc/convert.py(101): convert_model
  <stdin>(1): <module>

Resources

Contact points

@openvinotoolkit/openvino-tf-frontend-maintainers

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 23 (16 by maintainers)

Commits related to this issue

Most upvoted comments

@mvafin @rkazants Most thanks for both of you!i have fix the problem under the environment of torch=2.0.1, openvino=2023.1.0

i want to try this issue can you please assign it to me ?