137 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
28
views
Gradcam with ResNet-50 Error: The name "input_layer_1" is used 2 times in the model. All operation names should be unique
I am new to the implementation of Gradcam, and having a trouble with it.
I have created a model
img_shape = (256, 256, 3)
base_model = ResNet50(include_top=False,
...
0
votes
0
answers
52
views
How to resolve AttributeError: 'str' object has no attribute '_type_enum' in tensorflow?
I'm experimenting with gradients of individual losses, but I can't get the gradient of the single loss_PDE loss to run with the unconnected_gradients argument included. It runs if I delete the ...
0
votes
1
answer
58
views
None Gradients for a model with 2 outputs
I have a model that has a GRU implementation inside and process audio samples. In each forward path I process a single sample of an audio file. To imitate the GRU behavior correctly, I have returned ...
0
votes
1
answer
83
views
gradient tape for custom loss function
I'm currently working with an autoencoder in hopes to test its accuracy vs pca. My tutor asked me to add a custom loss function that involves the derivatives of the decoder output with respect to the ...
0
votes
1
answer
95
views
How can I make a custom loss function in tensorflow, which takes inputs of model, predictions of model, and weights of model as it's parameters
I am trying to make a model which solves a partial differential equation (PDE). The problem is, it requires a make loss function which takes as its parameters:
Inputs given to model
Predictions of ...
0
votes
0
answers
37
views
How to track specific features in a gradient tape in Tensorflow without causing memory error?
I am manually trying to compute the gradient of how each one of the output features changes with each of the trainable parameters of my model. The model consists of several CNN layers and a last dense ...
0
votes
1
answer
62
views
TensorFlow: Calculating gradients of regularization loss terms dependent on model input and output
Overview
My model is an encoder that has input Z and output x.
I'm trying to use a total_loss that has both traditional supervised learning and regularization term(s). I have additional functions (...
1
vote
0
answers
38
views
How to use Encoder predictions for additional loss and gradient calculations (Tensorflow)
Problem
I'm having troubles correctly adding physics-informed losses to my training code for my neural network.
Background
I have an encoder that takes an input curve, X(w), where w is an independent ...
2
votes
0
answers
79
views
What does output_gradient do in GradientTape().gradient?
I was wondering what the output_gradients argument does in the gradient function of an GradientTape object in tensorflow. According to https://www.tensorflow.org/api_docs/python/tf/GradientTape#...
0
votes
0
answers
126
views
Tensorflow GradientTape keeps returning none when trying to define my own loss function
I am attempting to code a PINN (physics informed neural network) that has a custom loss function based off of partial differential equations that govern fluid flow. I have included a screenshot of the ...
0
votes
0
answers
35
views
GradientTape.gradient() returns `None` type
following is the code I'm trying to implement for meta learning using maml algorithm on a specific dataset. Inner loop works well, don't know why in the outerloop gradients are None.
def maml(...
1
vote
0
answers
84
views
Gradients are None with tf.map_fn in TensorFlow
In the code I just simulate gradient backpropagation with respect to a fictional randomly simulated image classification dataset.
The scenario is :
A dataset which gives (images,labels) pair.
A model ...
2
votes
1
answer
287
views
How to remove this Warning of casting imaginary into real values within tape.gradient method of tensorflow?
I am using tape.gradient method for optimising some neural networks. It works as expected but keeps giving this warning when I calculate the gradient using tape.gradients, multiple times in a single ...
1
vote
2
answers
334
views
tf.keras.optimizers.Adam.apply_gradients triggers tf.function retracing
I'm getting a memory leak and I believe it to be linked to the following warning:
WARNING:tensorflow:6 out of the last 6 calls to <function _BaseOptimizer._update_step_xla at 0x7fa9f8074c20> ...
0
votes
0
answers
36
views
How to get gradients from GradientTape
I wanted to get the gradients from the gradient tape so in tf version 1 I used something like -
grads = model.optimizer.get_gradients(model.total_loss, model.trainable_weights)
symb_inputs = (model....