简体   繁体   English

无法更新tensorflow的版本

[英]Not able to update the version of tensorflow

I am facing the below error while running the code for LinearClassifier in tensorflow. 我在Tensorflow中运行LinearClassifier的代码时遇到以下错误。

AttributeError: module 'tensorflow.python.estimator.estimator_lib' has no attribute 'LinearRegressor' AttributeError:模块“ tensorflow.python.estimator.estimator_lib”没有属性“ LinearRegressor”

My current version for tensorflow is 1.2.1. 我当前的tensorflow版本是1.2.1。 I tried to update the version of the package from ANACONDA environment, its not showing for an upgrade. 我尝试从ANACONDA环境更新该软件包的版本,但未显示升级版本。

I tried to upgrade it from command prompt by using below command, it is successfully updating the package however it is not reflecting to the actual library when I am using it. 我试图通过使用以下命令从命令提示符升级它,它已成功更新了软件包,但是当我使用它时,它并没有反映到实际的库中。

pip install --upgrade tensorflow==1.3.0 点安装--upgrade tensorflow == 1.3.0

FYI, I am using Jupyter Notebook and have created a separate environment for tensorflow. 仅供参考,我正在使用Jupyter Notebook,并为tensorflow创建了一个单独的环境。

Please let me know if I have missed anything. 如果我错过了任何事情,请告诉我。

That should work. 那应该工作。 Check if you are using any environment but you are not updating the tensorflow version within the environment . 检查您是否正在使用任何环境,但没有在该环境中更新tensorflow版本。

Also, please restart the notebook after saving it and run the cells and try. 另外,请在保存笔记本后重新启动笔记本计算机并运行单元并尝试。 That should work. 那应该工作。

Verify in the notebook : run - print(tf.__version__) . 在笔记本中验证:run- print(tf.__version__) Please mark the answer if it resolves. 如果解决,请标记答案。

If your command pip install --upgrade tensorflow compiles, then your version of tensorflow should be the newest. 如果您的命令pip install --upgrade tensorflow编译,则您的tensorflow版本应该是最新的。 However you should restart your notebook. 但是,您应该重新启动笔记本。 Also, as you said that you are using anaconda. 另外,正如您所说的,您正在使用anaconda。 You can also install and upgrade tensorflow as follows: 您还可以如下安装和升级tensorflow:

 conda install -c conda-forge tensorflow  # to install
 conda upgrade -c conda-forge tensorflow  # to upgrade

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM