【发布时间】:2020-01-03 18:07:27
【问题描述】:
有没有办法切换 tensorflow 的版本?当我使用 conda 安装 tensorflow 2.0 时,它更新了很多东西,甚至是 python。在运行conda list 时,它显示了两个版本;
张量流 2.0.0 mkl_py37h66b46cc_0
张量流 1.13.1
为了使用 1.x 版本,建议将 here 替换为以下内容:import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
使用此方法是安全的,只需添加这些行?,在我的情况下,它显示一个警告:WARNING:tensorflow:From /home/common/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/compat/v2_compat.py:65: 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
【问题讨论】:
标签: python tensorflow anaconda