当前位置:网站首页>tensorflow和torch代码验证cuda是否安装成功
tensorflow和torch代码验证cuda是否安装成功
2022-07-06 11:10:00 【愚昧之山绝望之谷开悟之坡】
tensorflow代码验证cuda是否安装成功
tensorflow 测试 cuda 是否安装成功,测试代码环境
tensorflow
import tensorflow as tf
tf.test.is_gpu_available()
或者
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())
边栏推荐
- [depth first search] Ji suanke: find numbers
- AIRIOT物联网平台赋能集装箱行业构建【焊接工位信息监控系统】
- 人体骨骼点检测:自顶向下(部分理论)
- Collection of penetration test information -- use with nmap and other tools
- R语言ggplot2可视化:使用ggpubr包的ggdotplot函数可视化点阵图(dot plot)、设置palette参数设置不同水平点阵图数据点和箱图的颜色
- 如何提高网站权重
- R语言ggplot2可视化时间序列柱形图:通过双色渐变配色颜色主题可视化时间序列柱形图
- Test 123
- 裕太微冲刺科创板:拟募资13亿 华为与小米基金是股东
- Bonecp uses data sources
猜你喜欢

Visual Studio Code启动时提示“Code安装似乎损坏。请重新安装。”、标题栏显示“不受支持”信息的解决办法

Analysis of frequent chain breaks in applications using Druid connection pools
![[depth first search] Ji suanke: Square](/img/fc/e42ae0d036be258bed5623d55fc2db.jpg)
[depth first search] Ji suanke: Square

手写一个的在线聊天系统(原理篇1)

【论文笔记】TransUNet: Transformers Make StrongEncoders for Medical Image Segmentation

同宇新材冲刺深交所:年营收9.47亿 张驰与苏世国为实控人

Use cpolar to build a business website (1)

How to improve website weight

openmv4 学习笔记1----一键下载、图像处理背景知识、LAB亮度-对比度
![[matlab] Simulink the input and output variables of the same module cannot have the same name](/img/99/adfe50075010916439cd053b8f04c7.png)
[matlab] Simulink the input and output variables of the same module cannot have the same name
随机推荐
Specify flume introduction, installation and configuration
pytorch常见损失函数
Afnetworking framework_ Upload file or image server
Jushan database was among the first batch of financial information innovation solutions!
Binary search tree
First, look at K, an ugly number
The dplyr package of R language performs data grouping aggregation statistical transformations and calculates the grouping mean of dataframe data
能源行业的数字化“新”运维
Openmv4 learning notes 1 --- one click download, background knowledge of image processing, lab brightness contrast
Breadth first traversal of graph
Implementation of AVL tree
Some recruitment markets in Shanghai refuse to recruit patients with covid-19 positive
Tongyu Xincai rushes to Shenzhen Stock Exchange: the annual revenue is 947million Zhang Chi and Su Shiguo are the actual controllers
AIRIOT物联网平台赋能集装箱行业构建【焊接工位信息监控系统】
wx小程序学习笔记day01
[depth first search] Ji suanke: a joke of replacement
10、 Process management
裕太微冲刺科创板:拟募资13亿 华为与小米基金是股东
Medical image segmentation
监控界的最强王者,没有之一!