Skip to content
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

Trying to convert weights to TensorRT Graph tensorflow version issue #28

Open
dt1729 opened this issue Apr 28, 2024 · 0 comments
Open

Comments

@dt1729
Copy link

dt1729 commented Apr 28, 2024

Installed packages:
packages.txt

GTX 1070 8Gb memory, Ryzen 5, Ubuntu 20.04

When I try to convert the model weights to TensorRT engines I get the following error:

  File "/home/dt/miniconda3/envs/TensorRT/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 497, in _import_graph_def_internal
    graph._c_graph, serialized, options)  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: NodeDef mentions attr 'validate_shape' not in Op<name=AssignVariableOp; signature=resource:resource, value:dtype -> ; attr=dtype:type; is_stateful=true>; NodeDef: {{node AssignNewValue}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dt/miniconda3/envs/TensorRT/lib/python3.6/site-packages/tensorflow/python/compiler/tensorrt/trt_convert.py", line 1085, in convert
    self._input_saved_model_tags)
  File "/home/dt/miniconda3/envs/TensorRT/lib/python3.6/site-packages/tensorflow/python/saved_model/load.py", line 578, in load
    return load_internal(export_dir, tags)
  File "/home/dt/miniconda3/envs/TensorRT/lib/python3.6/site-packages/tensorflow/python/saved_model/load.py", line 604, in load_internal
    export_dir)
  File "/home/dt/miniconda3/envs/TensorRT/lib/python3.6/site-packages/tensorflow/python/saved_model/load.py", line 116, in __init__
    meta_graph.graph_def.library))
  File "/home/dt/miniconda3/envs/TensorRT/lib/python3.6/site-packages/tensorflow/python/saved_model/function_deserialization.py", line 311, in load_function_def_library
    func_graph = function_def_lib.function_def_to_graph(copy)
  File "/home/dt/miniconda3/envs/TensorRT/lib/python3.6/site-packages/tensorflow/python/framework/function_def_to_graph.py", line 63, in function_def_to_graph
    importer.import_graph_def_for_function(graph_def, name="")
  File "/home/dt/miniconda3/envs/TensorRT/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 412, in import_graph_def_for_function
    graph_def, validate_colocation_constraints=False, name=name)
  File "/home/dt/miniconda3/envs/TensorRT/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 501, in _import_graph_def_internal
    raise ValueError(str(e))
ValueError: NodeDef mentions attr 'validate_shape' not in Op<name=AssignVariableOp; signature=resource:resource, value:dtype -> ; attr=dtype:type; is_stateful=true>; NodeDef: {{node AssignNewValue}}. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).

What tensorflow version was used to save these weights? I am using the same requirements.txt for my environment but still running into this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant