这里提供的代码时1.x版本的tensorflow可运行的代码,如果安装的2.x版本的tensorflow可以在上段代码的前面加上下面两句话(本意是导入1.x版本的tensorflow且使得2.x版本的语句失效,不过这个方法会出现警告,有一天可能会失效~~)

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()



disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term


#即disable_resource_variables在未来的版本中会被去掉
在这里插入图片描述

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐