当前位置:网站首页>tensorflow 调用多块GPU的一些错误
tensorflow 调用多块GPU的一些错误
2022-07-25 10:27:00 【fatfatmomo】
服务器两块GPU,跑tensorflow 版bert想将两块GPU都用上。看了别的教程说有两种方法,在windows server 2016上试验了一下,用的GPU-Z工具进行GPU观察,因为windows server的任务管理器是个阉割版看不到GPU性能。
方法一:
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"#指定显卡1运行
###如果想用多块显卡可以按如下方式,但是未经测试,我的代码在estimator写的,应该是后期GPU处理上自己要分配GPU资源才能多块GPU并行,我按如下方式电脑会取你设置运行的显卡里的第一个显卡来运行###
os.environ['CUDA_VISIBLE_DEVICES'] = '1,0',
方法二:
config = tf.ConfigProto(device_count={'GPU': 0})
###GPU:0 表示使用CPU不使用GPU,GPU:1表示使用GPU###
边栏推荐
- SQL语言(五)
- The University of Gottingen proposed clipseg: a model that can perform three segmentation tasks simultaneously using text and image prompts
- Learn NLP with Transformer (Chapter 5)
- Flask framework - flask WTF form: data validation, CSRF protection
- Esp8266 uses drv8833 drive board to drive N20 motor
- Use three.js to realize the cool cyberpunk style 3D digital earth large screen
- 企业实践开源的动机
- SQL语言(二)
- Code representation learning: introduction to codebert and other related models
- Druid 查询超时配置的探究 → DataSource 和 JdbcTemplate 的 queryTimeout 到底谁生效?
猜你喜欢

NowCoderTOP1-6——持续更新ing

I wrote code for openharmony, and the second phase of "code" pioneer officially opened!

The most detailed MySQL index analysis (mind map is attached at the end of the article)

【IJCAI 2022】参数高效的大模型稀疏训练方法,大幅减少稀疏训练所需资源

SQL语言(二)

机智云物联网平台 STM32 ESP8266-01S 简单无线控灯

From the perspective of open source, analyze the architecture design of SAP classic ERP that will not change in 30 years

HCIA experiment (07) comprehensive experiment

The idea has been perfectly verified again! The interest rate hike is approaching, and the trend is clear. Take advantage of this wave of market!

100W了!
随机推荐
Learn NLP with Transformer (Chapter 8)
Learn NLP with Transformer (Chapter 7)
DICOM medical image viewing and browsing function based on cornerstone.js
代码的表示学习:CodeBERT及其他相关模型介绍
树形动态规划
Last week's hot review (7.18-7.24)
HCIP (01)
HCIP(12)
C# Newtonsoft.Json 高级用法
信号完整性(SI)电源完整性(PI)学习笔记(三十四)100条估计信号完整性效应的经验法则
Learn NLP with Transformer (Chapter 4)
一文读懂小程序的生命周期和路由跳转
HCIP(13)
HCIA实验(09)
Understand the life cycle and route jump of small programs
微信小程序版本更新如何通知用户?
Hcip experiment (04)
JS bidirectional linked list 02
The practice of asynchronous servlet in image service
上周热点回顾(7.18-7.24)