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

TypeError: An op outside of the function building code is being passed a "Graph" tensor. #7

Open
Tipper-sun opened this issue Feb 10, 2023 · 1 comment

Comments

@Tipper-sun
Copy link

my problem:
TypeError: An op outside of the function building code is being passed
a "Graph" tensor. It is possible to have Graph tensors
leak out of the function building context by including a
tf.init_scope in your function building code.
For example, the following function will fail:
@tf.function
def has_init_scope():
my_constant = tf.constant(1.)
with tf.init_scope():
added = my_constant * 2
The graph tensor has name: block1_conv1/kernel:0

@nacayu
Copy link
Owner

nacayu commented Feb 11, 2023

https://blog.csdn.net/sinat_28494049/article/details/104663053
Some strange problems you can search on google first, this mignt be version setting problem

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

2 participants