当前位置:网站首页>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())
边栏推荐
- 关于静态类型、动态类型、id、instancetype
- Nuc11 cheetah Canyon setting U disk startup
- 10、 Process management
- ORACLE进阶(四)表连接讲解
- Yutai micro rushes to the scientific innovation board: Huawei and Xiaomi fund are shareholders to raise 1.3 billion
- openmv4 学习笔记1----一键下载、图像处理背景知识、LAB亮度-对比度
- On AAE
- [depth first search] Ji suanke: Square
- How does crmeb mall system help marketing?
- Atcoder a mountaineer
猜你喜欢

Breadth first traversal of graph

2022-2024年CIFAR Azrieli全球学者名单公布,18位青年学者加入6个研究项目

About NPM install error 1
![A wearable arm device for night and sleeveless blood pressure measurement [translation]](/img/fd/947a38742ab1c4009ec6aa7405a573.png)
A wearable arm device for night and sleeveless blood pressure measurement [translation]

Docker installation redis

Online notes

Some understandings of tree LSTM and DGL code implementation
![[Sun Yat sen University] information sharing of postgraduate entrance examination and re examination](/img/a8/41e62a7a8d0a2e901e06c751c30291.jpg)
[Sun Yat sen University] information sharing of postgraduate entrance examination and re examination
![[depth first search] Ji suanke: Square](/img/fc/e42ae0d036be258bed5623d55fc2db.jpg)
[depth first search] Ji suanke: Square

Penetration test information collection - WAF identification
随机推荐
R language ggplot2 visualization: use the ggstripchart function of ggpubr package to visualize the grouped dot strip plot, and set the add parameter to add box plots for different levels of dot strip
关于npm install 报错问题 error 1
Binary search tree
裕太微冲刺科创板:拟募资13亿 华为与小米基金是股东
Online notes
R language uses the order function to sort the dataframe data, and descending sorting based on a single field (variable)
Mathematics in machine learning -- common probability distribution (XIII): Logistic Distribution
Meilu biological IPO was terminated: the annual revenue was 385million, and Chen Lin was the actual controller
基于蝴蝶种类识别
AutoCAD - what is the default lineweight for centerline drawing and CAD? Can I modify it?
Optical blood pressure estimation based on PPG and FFT neural network [translation]
About static type, dynamic type, ID, instancetype
关于静态类型、动态类型、id、instancetype
Video based full link Intelligent Cloud? This article explains in detail what Alibaba cloud video cloud "intelligent media production" is
Understanding disentangling in β- VAE paper reading notes
一种用于夜间和无袖测量血压手臂可穿戴设备【翻译】
node の SQLite
Stm32+esp8266+mqtt protocol connects onenet IOT platform
R language uses rchisq function to generate random numbers that conform to Chi square distribution, and uses plot function to visualize random numbers that conform to Chi square distribution
深度循环网络长期血压预测【翻译】