首页 > 其他 > 详细

tensorflow(三):安装与测试

时间:2021-03-29 15:29:43      阅读:22      评论:0      收藏:0      [点我收藏+]

一、安装

1、配置国内源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

2、显示源地址

conda config --set show_channel_urls yes
安装
conda create -n tf2 tensorflow-gpu
conda activate tf2

二、测试安装

import os
os.environ[TF_CPP_MIN_LOG_LEVEL]=2

import tensorflow as tf

a = tf.constant(1.)
b = tf.constant(2.)
print(a+b)

print(GPU:, tf.test.is_gpu_available())

 

tensorflow(三):安装与测试

原文:https://www.cnblogs.com/zhangxianrong/p/14592290.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!