Open Liozizy opened 3 years ago
use tensorflow 1.x (like 1.15)
Try
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
Try to do it in TensorFlow 1 because there are some major changes to the first version. Plus, I recommend using Google Colab instead of local processors because installing tf 1 is much easier (you don't have to change your python or IDE version. you can take a look at my repo for more details.
@amiralizadeh1 google colab no longer support tensor 1.x
tensorflow 1.15.0 python 3.6
tensorflow 1.15.0 python 3.6
wow,thank y
When I try to define a layer as loss by myself and use the add_weight() function to declare the trainable return propagation variable,Threw an error:
ValueError: Variable <tf.Variable ‘eqn1_1/constant1:0’ shape=(1,) dtype=float32> has None for gradient. Please make sure that all of your ops have a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval.
My code is as follows:
The whole error when I train the model is as follows:
Hope get some help. Thank you!