码迷,mamicode.com
首页 > Windows程序 > 详细

Windows上安装 TensorFlow

时间:2018-02-12 16:48:08      阅读:474      评论:0      收藏:0      [点我收藏+]

标签:需要   post   org   this   could   col   could not   doc   下载   

1、官网及帮助文档 

官网: https://www.tensorflow.org/install/install_windows

 中文帮助文档:https://efeiefei.gitbooks.io/tensorflow_documents_zh/install/install_windows.html

a) cpu版本安装:pip3 install --upgrade tensorflow 

b)gpu版本安装:pip3 install --upgrade tensorflow-gpu,需要先安装cuda,cudnn,需要注意版本

备注:目前tensorflow在windows只支持python3.5.x及以上版本,需要使用pip3安装tensorflow。

2、cpu版本安装可能遇到的问题

2.1、ImportError: Could not find ‘msvcp140.dll‘. TensorFlow requires that this DLL... ,解决方案:安装微软为VS2015提供的组件Visual C++ Redistributable for Visual Studio 2015,网址https://www.microsoft.com/zh-CN/download/details.aspx?id=48145,下载后直接安装就好了。

2.2、Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2,应该是编译问题,解决方案:

import os
os.environ[TF_CPP_MIN_LOG_LEVEL] = 2  #忽略警告

3、简单命令

a)查看tensorflow版本及安装路径

import tensorflow as tf
tf.
__version__ #版本
tf.__path__ #路径

 

Windows上安装 TensorFlow

标签:需要   post   org   this   could   col   could not   doc   下载   

原文地址:https://www.cnblogs.com/ying-chease/p/8444578.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!