当前位置:网站首页>Tensorflow and torch code verify whether CUDA is successfully installed
Tensorflow and torch code verify whether CUDA is successfully installed
2022-07-06 19:05:00 【The mountain of ignorance, the valley of despair, the slope of 】
tensorflow Code validation cuda Is the installation successful
tensorflow test cuda Is the installation successful , Test code environment
tensorflow
import tensorflow as tf
tf.test.is_gpu_available()
perhaps
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
torch
import torch
flag = torch.cuda.is_available()
print(flag)
gpunumber = 1
Decide which device we want to run on
device = torch.device("cuda:0" if (torch.cuda.is_available() and gpunumber > 0) else "cpu")
print(device)
print(torch.cuda.get_device_name(0))
print(torch.rand(3,3).cuda())
边栏推荐
- 能源行业的数字化“新”运维
- Jdbc driver, c3p0, druid and jdbctemplate dependent jar packages
- R语言dplyr包进行数据分组聚合统计变换(Aggregating transforms)、计算dataframe数据的分组均值(mean)
- 同宇新材冲刺深交所:年营收9.47亿 张驰与苏世国为实控人
- Collection of penetration test information -- use with nmap and other tools
- Abstract classes and abstract methods
- Master Xuan joined hands with sunflower to remotely control enabling cloud rendering and GPU computing services
- Hongke shares | plate by plate ar application in Beijing Winter Olympics
- Mathematics in machine learning -- common probability distribution (XIII): Logistic Distribution
- 爬虫玩得好,牢饭吃到饱?这3条底线千万不能碰!
猜你喜欢
Nuc11 cheetah Canyon setting U disk startup
About static type, dynamic type, ID, instancetype
【论文笔记】TransUNet: Transformers Make StrongEncoders for Medical Image Segmentation
Deep circulation network long-term blood pressure prediction [translation]
php+redis实现超时取消订单功能
裕太微冲刺科创板:拟募资13亿 华为与小米基金是股东
Human bone point detection: top-down (part of the theory)
AutoCAD - what is the default lineweight for centerline drawing and CAD? Can I modify it?
Collection of penetration test information -- use with nmap and other tools
Mathematics in machine learning -- common probability distribution (XIII): Logistic Distribution
随机推荐
Mathematics in machine learning -- common probability distribution (XIII): Logistic Distribution
How word displays modification traces
助力安全人才专业素养提升 | 个人能力认证考核第一阶段圆满结束!
ORACLE进阶(四)表连接讲解
Stm32+hc05 serial port Bluetooth design simple Bluetooth speaker
There is a sound prompt when inserting a USB flash disk under win10 system, but the drive letter is not displayed
美庐生物IPO被终止:年营收3.85亿 陈林为实控人
The role of applet in industrial Internet
pytorch常见损失函数
一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
ACTF 2022圆满落幕,0ops战队二连冠!!
裕太微冲刺科创板:拟募资13亿 华为与小米基金是股东
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
R语言使用dt函数生成t分布密度函数数据、使用plot函数可视化t分布密度函数数据(t Distribution)
[paper notes] transunet: transformers make strongencoders for medical image segmentation
根据PPG估算血压利用频谱谱-时间深度神经网络【翻】
Helm deploy etcd cluster
Oracle advanced (IV) table connection explanation
Three years of Android development, Android interview experience and real questions sorting of eight major manufacturers during the 2022 epidemic
Lucun smart sprint technology innovation board: annual revenue of 400million, proposed to raise 700million