编程技术网

关注微信公众号,定时推送前沿、专业、深度的编程技术资料。

 找回密码
 立即注册

QQ登录

只需一步,快速开始

极客时间

警告:带有约束的tensorflow已过时,将在以后的版本中删除:WARNING:tensorflow with constraint is deprecated and will be removed in a future version

akoenig Tensorflow 2022-5-10 14:41 13人围观

腾讯云服务器
警告:带有约束的tensorflow已过时,将在以后的版本中删除的处理方法

我正在遵循Tensorflow关于构建简单神经网络的教程,并且在导入了必要的库(tensorflow,keras,numpy& matplotlib)和数据集(fashion_mnist)之后,按照教程运行了此代码:

I am following Tensorflow's tutorial on building a simple neural network, and after importing the necessary libraries (tensorflow, keras, numpy & matplotlib) and datasets (fashion_mnist) I ran this code as per the tutorial:

model = keras.Sequential([ keras.layers.Flatten(input_shape=(28, 28)), keras.layers.Dense(128, activation='relu'), keras.layers.Dense(10, activation='softmax') ]) 

运行此代码后,我收到此警告消息:

after running this code i received this warning message:

警告:tensorflow:来自/Applications/anaconda3/envs/tensorfloe/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630:调用BaseResourceVariable.初始化(来自带有约束的tensorflow.python.ops.resource_variable_ops)是不推荐使用,将在以后的版本中删除.说明更新:如果使用Keras,则将* _constraint参数传递给图层.

WARNING:tensorflow:From /Applications/anaconda3/envs/tensorfloe/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version. Instructions for updating: If using Keras pass *_constraint arguments to layers.

我该如何解决?非常感谢您的帮助.

How do i fix this? Your help is highly appreciated.

问题解答

这是内部TensorFlow消息,您可以放心地忽略它.在将来的TensorFlow版本中将消失,无需您采取任何行动.

This is internal TensorFlow message, you can safely ignore it. It will be gone in future versions of TensorFlow, no actions from your side is needed.

这篇关于警告:带有约束的tensorflow已过时,将在以后的版本中删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程技术网(www.editcode.net)!

腾讯云服务器

相关推荐

阿里云服务器
关注微信
^