Win10+Tensorflow+CPU安装配置

最近学习tensorflow,学习记录,加深印象。

1. 安装,没有安装anc,win10之前配置了python2、3的环境。

 tensorflow支持python3。

管理员打开cmd输入:

>pip3 install --upgrade tensorflow

安装好之后,ipython:

ipytohn
import tensorflow

出现错误:

ImportError: Could not find 'msvcp140.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. You may install this DLL by downloading Visual C++ 2015 Redistributable Update 3 from this URL: https://www.microsoft.com/en-us/download/details.aspx?id=53587

解决方案:安装微软为VS2015提供的组件Visual C++ Redistributable for Visual Studio 2015,网址:

https://www.microsoft.com/zh-CN/download/details.aspx?id=48145

下载后直接安装就OK。

继续import,没有报错。emmmmm.....可能OK了?跑个输出吧。

输出例子:

import tensorflow as tf


out = tf.constant("hello world!")

session = tf.Session()

print(session.run(out))

结果:

 

图中格式呢 是vscode+jupyter 插件搞得 跑一些段代码还是很方便的。完了记录一下;感觉好多东西都忘记了,不记下来,再看的时候完全懵.....是时候博客搞起来了。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值