python3.6安装tensorflow失败,Tensorflow安装失败,并显示“模块的编译时版本3.5与运行时版本3.6不匹配”。...

I tried installing from pip:

pip3 install --user --no-cache https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.4.0-cp36-cp36m-linux_x86_64.whl

Then tried importing and got:

Using TensorFlow backend.

/usr/lib64/python3.6/importlib/_bootstrap.py:205: RuntimeWarning:

compiletime version 3.5 of module

'tensorflow.python.framework.fast_tensor_util' does not match runtime

version 3.6

return f(*args, **kwds)

2017-11-10 09:35:01.206112: I

tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports

instructions that this TensorFlow binary was not compiled to use: SSE4.1

SSE4.2 AVX

Questions:

I don't understand why the wheel says 3.6, but I get the warning about 3.5

I want to compile to optimize for my cpu, so can I use pip to install from source rather than from binary wheel?

解决方案RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6

This is a known issue, which is got prioritized and likely to be fixed soon. Right now the workaround is to use python 3.5.

UPDATE:

The issue has been fixed in the nightly tensorflow builds: "tf-nightly and tf-nightly-gpu now has a python3.6 binary built from scratch for Linux."

I.e., the following command should work with python 3.6:

# tf-nightly or tf-nightly-gpu

pip3 install tf-nightly

Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX

This warning comes from the fact that the default tensorflow distributions are compiled without CPU extensions support (more on this here). If you want to get a CPU optimized tensorflow package, your only option is to build it yourself. It's a bit tedious, but absolutely doable. The build will produce the wheel file, which you can install with just

pip3 install /path/to/the/tensorflow.whl

But if you just want to suppress the warning, this will do:

import os

os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值