tensorflow-onnx icon indicating copy to clipboard operation
tensorflow-onnx copied to clipboard

ValueError: Input 2 of node StatefulPartitionedCall was passed float from stem_conv/kernel:0 incompatible with expected resource.

Open romygt opened this issue 2 years ago • 1 comments

Describe the bug Hey, I am trying to convert the model from EfficientPose repo into onnx. /usr/lib/python3.7/runpy.py:125: RuntimeWarning: 'tf2onnx.convert' found in sys.modules after import of package 'tf2onnx', but prior to execution of 'tf2onnx.convert'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tf2onnx/verbose_logging.py:76: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

2022-02-15 14:48:26,386 - WARNING - From /usr/local/lib/python3.7/dist-packages/tf2onnx/verbose_logging.py:76: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.

2022-02-15 14:48:26,647 - WARNING - '--tag' not specified for saved_model. Using --tag serve 2022-02-15 14:48:26,647 - WARNING - '--signature_def' not provided. Using all signatures. Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/importer.py", line 501, in _import_graph_def_internal graph._c_graph, serialized, options) # pylint: disable=protected-access tensorflow.python.framework.errors_impl.InvalidArgumentError: Input 2 of node StatefulPartitionedCall was passed float from stem_conv/kernel:0 incompatible with expected resource.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/dist-packages/tf2onnx/convert.py", line 633, in main() File "/usr/local/lib/python3.7/dist-packages/tf2onnx/convert.py", line 285, in main output_path=args.output) File "/usr/local/lib/python3.7/dist-packages/tf2onnx/convert.py", line 161, in _convert_common tf.import_graph_def(frozen_graph, name='') File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/importer.py", line 405, in import_graph_def producer_op_list=producer_op_list) File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/framework/importer.py", line 505, in _import_graph_def_internal raise ValueError(str(e)) ValueError: Input 2 of node StatefulPartitionedCall was passed float from stem_conv/kernel:0 incompatible with expected resource. Here is the error I am receiving

Urgency

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 18.04*):
  • TensorFlow Version:
  • Python version:
  • ONNX version (if applicable, e.g. 1.11*):
  • ONNXRuntime version (if applicable, e.g. 1.11*):

To Reproduce

Screenshots

Additional context

romygt avatar Apr 15 '23 12:04 romygt

According to the exception, this is most likely a bug of TensorFlow.

From the stack trace, the error happened at:

        if not kwargs.get("tflite_path") and not kwargs.get("tfjs_path"):
            tf.import_graph_def(frozen_graph, name='')

_(File "/usr/local/lib/python3.7/dist-packages/tf2onnx/convert.py", line 161, in convert_common tf.import_graph_def(frozen_graph, name=''))

import_graph_def() is actually a TensorFlow function which helps to import a frozen graph from the checkpoint. So please raise this issue in TensorFlow repo. Thanks.

fatcat-z avatar May 08 '23 04:05 fatcat-z