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

Running into: ValueError: cannot add an op with id 133 as it already exists in the graph #12

Open
madhavthaker opened this issue Apr 26, 2022 · 0 comments

Comments

@madhavthaker
Copy link

Tensorflow versions:

tensorflow               1.15.2
tensorflow-estimator     1.15.1
tensorflow-hub           0.9.0
tensorflow-text          1.15.1

I'm running the code as is and I'm consistently running into the following error:

/tmp/ipykernel_1454/3669827002.py in main()
     24             ops_list = g1.get_operations()
     25             for op in g1.get_operations():
---> 26                 copy_op_to_graph(op, g2, variables, scope)
     27             # copy table initilization
     28             copy_op_to_graph(tf.tables_initializer(), g2, variables, scope)

/tmp/ipykernel_1454/1749896782.py in copy_op_to_graph(org_instance, to_graph, variables, scope)
    190                            op_def)
    191     #Use Graph's hidden methods to add the op
--> 192     to_graph._add_op(new_op)  # pylint: disable=protected-access
    193     to_graph._record_op_seen_by_control_dependencies(new_op)
    194     for device_function in reversed(to_graph._device_function_stack):

/opt/miniconda/envs/product_recos_description_model/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py in _add_op(self, op)
   3015       if op._id in self._nodes_by_id:
   3016         raise ValueError("cannot add an op with id %d as it already "
-> 3017                          "exists in the graph" % op._id)
   3018       if op.name in self._nodes_by_name:
   3019         raise ValueError("cannot add op with name %s as that name "

ValueError: cannot add an op with id 133 as it already exists in the graph

I'm wondering if anyone else has run into this error.

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