tensorflow安装的坑

最近想装tensorflow,网上一搜,全是16年的帖子,按照帖子中提供的安装链接,都不靠谱,总是报下面的错误:

Collecting tensorflow==0.9.0 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x20d0b50>, 'Connection to storage.googleapis.com timed out. (connect timeout=15)')': /tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x20bcc50>, 'Connection to storage.googleapis.com timed out. (connect timeout=15)')': /tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x20bcb50>, 'Connection to storage.googleapis.com timed out. (connect timeout=15)')': /tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
/usr/local/python27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/python27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning


仔细看,发现是网上提供的链接已经过时,经过摸索,发现tensorflow的官方下载https://github.com/tensorflow/tensorflow

用下面这个命令安装,轻松搞定

$sudo pip install https://ci.tensorflow.org/view/Nightly/job/nightly-matrix-cpu/TF_BUILD_IS_OPT=OPT,TF_BUILD_IS_PIP=PIP,TF_BUILD_PYTHON_VERSION=PYTHON2,label=cpu-slave/lastSuccessfulBuild/artifact/pip_test/whl/tensorflow-1.0.0rc2-cp27-none-linux_x86_64.whl


但是接下来不断踩坑,

1. import tensorflow的时候报下面的错误

   version `GLIBCXX_3.4.19' not found 

    查了下,这个是gcc版本问题,按照下面这个帖子安装好gcc4.8.1,搞定这个坑

    http://www.yhaitao.net/centos6-5-compile-and-installgcc-4-8-1/

2. 再次import tensorflow,仍然有错误

     version `GLIBC_2.16' not found

 oooO ↘┏━┓ ↙ Oooo 
 ( 踩)→┃你┃ ←(死 ) 
  \ ( →┃√┃ ← ) / 
  \_)↗┗━┛ ↖(_/ 


  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
安装TensorFlow和Keras在Anaconda中,请按照以下步骤进行操作: 1. 首先,从Anaconda官网下载并安装Anaconda。请确保选择适用于你操作系统的版本。 2. 打开Anaconda Prompt(Windows)或命令行终端(Mac和Linux)。 3. 创建一个新的Python环境,可以使用以下命令: ``` conda create -n your_env_name python=X.X ``` 将`your_env_name`替换为你想要的环境名称,`X.X`替换为你想要的Python版本号(例如2.7或3.6)。 4. 激活新创建的环境,使用以下命令: ``` conda activate your_env_name ``` 5. 安装TensorFlow和Keras,可以使用以下命令: ``` conda install tensorflow-gpu keras ``` 这将安装TensorFlow GPU版本和Keras。 6. 安装完成后,你可以使用以下命令来验证安装: ``` conda list tensorflow-gpu keras ``` 这将显示已安装TensorFlow和Keras的版本号。 7. 如果你想在Jupyter Notebook中使用新创建的环境,请确保在激活环境的状态下安装Jupyter Notebook,并在激活环境的状态下启动Jupyter Notebook。 ``` conda install jupyter jupyter notebook ``` 这将启动Jupyter Notebook,并在默认浏览器中打开它。 请注意,这里提供的步骤仅适用于Anaconda环境中安装TensorFlow和Keras。确保按照上述步骤进行操作,以便正确安装所需的库和环境。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [手把手 Ubuntu16.04+cuda9.0+cudnn 7.1+Anaconda+tensorflow-gpu+keras-附件资源](https://download.csdn.net/download/weixin_42185419/15595517)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Anaconda安装Tensorflow+keras](https://blog.csdn.net/daodanxiansheng/article/details/88132980)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [【避指南】Windows10中使用Anaconda安装tensorflow+keras](https://blog.csdn.net/hutianle/article/details/126426446)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值