Closed
Description
I am porting the Keras Actor Critic Method to Tensforflow.net and when I attempt to calculate the gradients it returns null.
using (var tape = tf.GradientTape())
{
// ....
// relevant code
float loss_value = actor_losses_sum + critic_losses_sum;
Tensor loss_value_tensor = tf.convert_to_tensor(loss_value);
var grads = tape.gradient(loss_value_tensor, model.trainable_variables);
}
I have posted the full source code to reproduce the issue on this [Gist].(https://gist.github.com/alexhiggins732/320286f89e53c3bb3ae291f5979db1f3)
I have research and found several example saying tape.watch
may need to be called but I have tried "watching" several tensors with no success.
Metadata
Metadata
Assignees
Labels
No labels