如何修复&quot'警告:tensorflow:@custom_gradient grad_fn具有'变量'在签名中,但是在远期通行证上没有使用资源价加?
使用model.fit()
或model.summary()
时,我一直在警告。使用(在Windows 10上):
- TensorFlow 2.6.2
- TensorFlow概率0.14
- KERAS 2.6
还在Google Colab上使用TF == 2.8,TFP == 0.16,Keras == 2.8
,没有任何更改。
试图降低张力和tf-probya,如所建议的此处(用于其他实现)但是没有工作。我的模型是这个模型,但是我在不同的隐藏层和使用功能API时也遇到了同样的问题:
model = Sequential()
model.add(keras.Input(shape=(dataset.shape[1],1)))
model.add(tfkl.Conv1D(128, kernel_size = dataset.shape[1], activation='relu'))
model.add(tfkl.Conv1D(16, kernel_size = 1, activation='softplus'))
model.add( tfkl.Flatten())
model.add(tfkl.Dense(16, activation='softplus'))
model.add(tfkl.Dense(1, use_bias = 1))
model.add(tfpl.DistributionLambda(
lambda t: tfd.Chi2(df= abs(t[..., :1])
)))
请注意,使用tfd.normal
(只有<<tfd.normal
)请注意。代码> tfd.chi2 和tfd.gamma
不起作用)。有人面临同样的问题吗?
I have been getting this warning when using model.fit()
or even model.summary()
. Using (on Windows 10):
- Tensorflow 2.6.2
- Tensorflow Probability 0.14
- Keras 2.6
Also tested on Google Colab with tf==2.8, tfp==0.16, keras==2.8
, without any change.
Tried to downgrade Tensorflow and TF-probability as suggusted here (for a different implementation) but did not work. My model is this, however I've had the same issue with different hidden layers and also when used a functional API:
model = Sequential()
model.add(keras.Input(shape=(dataset.shape[1],1)))
model.add(tfkl.Conv1D(128, kernel_size = dataset.shape[1], activation='relu'))
model.add(tfkl.Conv1D(16, kernel_size = 1, activation='softplus'))
model.add( tfkl.Flatten())
model.add(tfkl.Dense(16, activation='softplus'))
model.add(tfkl.Dense(1, use_bias = 1))
model.add(tfpl.DistributionLambda(
lambda t: tfd.Chi2(df= abs(t[..., :1])
)))
Note that I'm not having the same issue when using tfd.Normal
(only tfd.Chi2
and tfd.Gamma
don't work). Anyone faced the same issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论