模块tensorflow没有属性contrib

2024-04-19 03:58:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用基于tensorflow 1.6的教程编写了一段代码,该教程使用“contrib”,这与我当前的tensorflow verison(2.1.0)不兼容

我无法运行升级脚本,降级我的tf版本会导致另一系列问题

我还尝试过在TensorFlow2中使用其他模块,比如tensorflow插件和禁用Version2行为

怎么办


Tags: 模块代码版本脚本插件tftensorflow教程
1条回答
网友
1楼 · 发布于 2024-04-19 03:58:57

谢谢@jdehesa

这是TensorFlow官方网站上的信息

Warning: The tf.contrib module is not included in TensorFlow 2. Many of its submodules have been integrated into TensorFlow core, or spun-off into other projects like tensorflow_io, or tensorflow_addons. For instructions on how to upgrade see the Migration guide.

https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/contrib

https://www.tensorflow.org/guide/migrate

或者,您可以将代码转换为TF2.x的适当版本

相关问题 更多 >