2

How does one access and update trainable variables when using eager execution and a keras sequential model? I see some code in the tf optimizer that seems to handle both graph mode and eager execution, but it's really hard for me to follow. I'd like to know more directly how to update the trainable variables manually so i can use my own optimizer.

Note/FYI....When i try to assign a new value using an "=" sign to the output of the model.variables call, i get a "TypeError: 'ResourceVariable' object does not support item assignment".

I found an answer here on github, but it didn't work for me....throws an "AttributeError: 'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'assign'"

user3496060
  • 800
  • 10
  • 20

0 Answers0