-
Notifications
You must be signed in to change notification settings - Fork 74k
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
[TF 2.0] Nested Gradient Tape - unconnected graphs #34335
Comments
@rmothukuru , thanks for your reply. |
@janbolle, |
@rmothukuru , yes, same error on my side. |
Chandan Kumar
On Nov 18, 2019 6:24 PM, "Jan Bollenbacher" <notifications@github.com> wrote:
@rmothukuru <https://github.com/rmothukuru> , yes, same error on my side.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#34335?email_source=notifications&email_token=AMUWCJI3UKK2QVZRZWSF4ODQUKGA5A5CNFSM4JOEEYF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEKKIUI#issuecomment-555000913>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMUWCJJLEZ5UJYBX3FEMQZ3QUKGA5ANCNFSM4JOEEYFQ>
.
|
Could reproduce the error with TF Version 2.0. Here is the Gist. Thanks! |
Also what is very odd: if I print the weights of the layers before and after the training, they are available. But if I use the function model_copy.get_weights() it results in an empty array. Following code: k = 0
for layer in range(len(model_copy.layers)):
# calculate adapted parameters w/ gradient descent
# \theta_i' = \theta - \alpha * gradients
print("pre: ", model_copy.layers[layer].kernel.shape, model_copy.layers[layer].kernel)
model_copy.layers[layer].kernel = tf.subtract(model_copy.layers[layer].kernel,
tf.multiply(alpha, gradients[k]))
model_copy.layers[layer].bias = tf.subtract(model_copy.layers[layer].bias,
tf.multiply(alpha, gradients[k + 1]))
print("post: ", model_copy.layers[layer].kernel.shape, model_copy.layers[layer].kernel)
k += 2
print(model_copy.get_weights()) # results in empty array |
@jvishnuvardhan do you need further information? Also, I think this is a bug, not a support case :-/ Maybe related to #29535 |
I was able to replicate the issue with Tf-nightly==2.2.0.dev20200318. |
I was able to replicate the issue with Tf-nightly==2.3.0-dev20200612.Please, find the gist here.Thanks!. |
I was able to replicate the issue with Tf-nightly==2.4.0-dev20200806, Please, find the gist here. |
Have there been any updates with this issue? Running into a similar |
Looking for updates on this as well! I am able to get my U-Net model to do an inner update, but this issue shows its only possible to do one inner update. |
Was able to replicate the issue in TF v2.5,please find the gist here..Thanks ! |
Was able to replicate the issue with TF 2.6.0-dev20210606,please find the gist here ..Thanks! |
I could reproduce the issue with TF 2.6 .Please, find the gist |
Hi There, This is a stale issue. As you are using an older version of tensorflow, we are checking to see if you still need help on this issue. Please test the issue with the latest TensorFlow (TF2.7 and tf-nightly). If the issue still persists with the newer versions of TF, please feel free to open it in keras-team/keras repository by providing details about the issue and a standalone code to reproduce the issue. Thanks! Please note that Keras development has moved to a separate Keras-team/keras repository to focus entirely on only Keras. Thanks! |
Still an issue with TF 2.7. Gist here |
Was there ever a resolution here? Curious why the issue was closed after the last poster confirmed it was still an issue in TF 2.7. |
System information
Describe the current behavior
A copy of my model (model_copy) should be trained one step, then I need my meta_model to be trained with the loss of my model_copy. It seems, that the graphs are unconnected.
It only works, if I use the meta_model for the training step.
Describe the expected behavior
I would expect, that model_copy is known to both gradient tapes and can be used w/o using meta_model.
Code to reproduce the issue
Other info / logs
Is it intended to work as above? This would force me not to be able to use a different optimizer in the inner loop, as the networks need somehow to be connected.
The text was updated successfully, but these errors were encountered: