当前位置:网站首页>ConnectionRefusedError: [Errno 111] Connection refused问题解决
ConnectionRefusedError: [Errno 111] Connection refused问题解决
2022-08-04 05:29:00 【≈落小朵】
解决方法一
same adress
对于我的电脑不好用
使用python指定GPU,如下
有一台服务器,服务器上有多块儿GPU可以供使用,但此时只希望使用第2块和第4块GPU,但是我们希望代码能看到的仍然是有两块GPU,分别编号为0,1,这个时候我们可以使用环境变量CUDA_VISIBLE_DEVICES来解决这个问题。
比如:
CUDA_VISIBLE_DEVICES=1 只有编号为1的GPU对程序是可见的,在代码中gpu[0]指的就是这块儿GPU
CUDA_VISIBLE_DEVICES=0,2,3 只有编号为0,2,3的GPU对程序是可见的,在代码中gpu[0]指的是第0块儿,gpu[1]指的是第2块儿,gpu[2]指的是第3块儿
CUDA_VISIBLE_DEVICES=2,0,3 只有编号为0,2,3的GPU对程序是可见的,但是在代码中gpu[0]指的是第2块儿,gpu[1]指的是第0块儿,gpu[2]指的是第3块儿
在python程序中,我们可以这么写
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
torch.cuda.is_available()
dev = torch.device("cuda") / torch.device("cpu")
边栏推荐
猜你喜欢

Briefly say Q-Q map; stats.probplot (QQ map)

TensorFlow2 study notes: 4. The first neural network model, iris classification

TensorFlow2 study notes: 5. Common activation functions

视图、存储过程、触发器

TensorFlow2 study notes: 7. Optimizer

【CV-Learning】卷积神经网络预备知识

多项式回归(PolynomialFeatures)

Deep Adversarial Decomposition: A Unified Framework for Separating Superimposed Images

Polynomial Regression (PolynomialFeatures)
![[Introduction to go language] 12. Pointer](/img/c8/4489993e66f1ef383ce49c95d78b1f.png)
[Introduction to go language] 12. Pointer
随机推荐
Various commands such as creating a new user in postgresql
ReentrantLock(公平锁、非公平锁)可重入锁原理
TypeError: load() missing 1 required positional argument: ‘Loader‘
光条中心提取方法总结(一)
TensorFlow2学习笔记:5、常用激活函数
PCL1.12 解决memory.h中EIGEN处中断问题
动手学深度学习_多层感知机
Thread 、Handler和IntentService的用法
【CV-Learning】目标检测&实例分割
yolov3中数据读入(一)
(十)树的基础部分(二)
空洞卷积
(十三)二叉排序树
PostgreSQL模式(Schema)
Redis持久化方式RDB和AOF详解
Halcon缺陷检测
(十六)图的基本操作---两种遍历
Th in thymeleaf: href use notes
计算某像素点法线
剑指 Offer 2022/7/12