Open zaqqwerty opened 2 years ago
Can you provide a minimal snippet that reproduces this issue ? It looks like this lookup is related to trying to get gradient info from the gradient op which could be caused by trying to do 2nd order or multi-tape things.
Still need to get a more minimal example. Most toggleable place it's turned up is line 144 of the tests here , where I found that adding persistent=True
to the gradient tape causes the error LookupError: No gradient defined for operation'TfqAdjointGradient'
to happen.
Some
tf.function
wrapped functions that only have a single tape result in:One possible cause is mentioned at this link:
So solving this seems like it would involve removing
tf.function
decoration from the library, leaving it up to users to decorate as desired.