刚入手TensorFlow,写一点关于配置的东西

最近一直想玩一下TensorFlow,身边很多朋友把它描述的神乎其神,自己又对NLP的一些内容想做一点点研究,打算自己搞一个。

我的电脑是 windowsX64环境,配一个CPU的玩一下。

我使用的Anconda作为解释器的,首先要安装对应的python,现在都是3.5+,当然要配置好环境变量--path路径添加Anconda的安装路径以及Anconda下的Scripts。

之后,就可以来安装TensorFlow了!

在cmd中使用命令  pip install --upgrade --ignore-installed tensorflow

一直等到安装完成就可以了。

这个时候,我们尝试一下:

import tensorflow as tf

a=tf.constant([1.0,2.0],name='a')

b=tf.constant([2.0,3.0],name='b')

result=tf.add(a,b,name='add')

print(result) 

 

正常输出结果为:

Tensor(“add:0”, shape=(2,), dtype=float32)

但是,可能会报一个futurewarning的错误,

FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.

这时候我们只需要更新一下包就可以:

pip install h5py==2.8.0rc1

这样就完成了。

 

转载于:https://www.cnblogs.com/GY-Zhu/p/9456958.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值