PaddleSeg
PaddleSeg copied to clipboard
[设置GPU为1号卡,不生效]
Thanks for your issue. To help us solve the issue better, please provide following information:
- PaddleSeg version:
- PaddleSeg version: (PaddleSeg release/2.3)
- PaddlePaddle version: (paddlepaddle-gpu 2.3.0)
- Operation system: (Linux)
- Python version: (Python3.6)
- CUDA/cuDNN version: (CUDA11.2)
- Additional context: (Add any other context about the problem)
在Linux上 单卡训练模型的时候( 有两张1080ti卡),可以看到0号卡在被使用,接下来x想设置1号卡来进行当下的训练

export CUDA_VISIBLE_DEVICES=1 # 设置1张可用的卡

结果可以看到,使用的是0号卡 进行训练,报一个显存溢出的错误

接下来做了如下的尝试,均报如上同样错误(设置为1号显卡,但是跑train的时候 使用的还是0号):
1 在代码内顶部设置
设置显卡1 跑程序
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
2 在代码内部设置

请您给出具体使用的paddleseg模型及使用方式,根据您目前提供的报错信息,可以参考如下文档:单卡训练及多卡训练的命令差异可参考https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.5/docs/train/train_cn.md
启动训练前执行:export CUDA_VISIBLE_DEVICES=1 # 设置1号卡 启动训练代码:python train.py --config configs\segformer\segformer_b4_cityscapes_1024x1024_160k.yml --do_eval --use_vdl --save_interval 500 --save_dir output 接下来,做了两种代码内设置1号卡的尝试,均报0号卡显存溢出错误(设置1号卡的操作并没有成功)
确实是有这个问题,我也是,都是使用 gpu:0
建议先升级到paddleseg 2.5,然后看下是否还存在该问题。 该问题此前缺失没遇到过。
是不是windows的问题,我用的是widows : set export CUDA_VISIBLE_DEVICES=1
我是linux
------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleSeg" @.>; 发送时间: 2022年7月12日(星期二) 下午2:53 @.>; @.@.>; 主题: Re: [PaddlePaddle/PaddleSeg] [设置GPU为1号卡,不生效] (Issue #2310)
是不是windows的问题,我用的是widows:set export CUDA_VISIBLE_DEVICES=1 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
export CUDA_VISIBLE_DEVICES=1
我这里linux下试了这两行命令: export CUDA_VISIBLE_DEVICES=1 python train.py --config configs/segformer/segformer_b4_cityscapes_1024x1024_160k.yml --do_eval --use_vdl --save_interval 500 --save_dir output 是在1号卡上跑的
谢谢,我也测试这个命令 它就不是在1号卡跑 很奇怪
------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleSeg" @.>; 发送时间: 2022年7月12日(星期二) 下午3:10 @.>; @.@.>; 主题: Re: [PaddlePaddle/PaddleSeg] [设置GPU为1号卡,不生效] (Issue #2310)
export CUDA_VISIBLE_DEVICES=1 我这里linux下试了这两行命令: export CUDA_VISIBLE_DEVICES=1 python train.py --config configs/segformer/segformer_b4_cityscapes_1024x1024_160k.yml --do_eval --use_vdl --save_interval 500 --save_dir output 是在1号卡上跑的 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
测试这个命令 它就不是在1号卡跑 很奇怪 我想可能是widonws 问题,因为我用的是win10出问题,linux我没试,懒得配置,以后再说 , 你是windos or linux ?
我一直用的linux!
------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleSeg" @.>; 发送时间: 2022年7月12日(星期二) 下午3:17 @.>; @.@.>; 主题: Re: [PaddlePaddle/PaddleSeg] [设置GPU为1号卡,不生效] (Issue #2310)
测试这个命令 它就不是在1号卡跑 很奇怪 我想可能是widonws 问题,因为我用的是win10出问题,linux我没试,懒得配置,以后再说,你是windos or linux ? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
谢谢,好的 我做一下尝试。
------------------ 原始邮件 ------------------ 发件人: "PaddlePaddle/PaddleSeg" @.>; 发送时间: 2022年7月12日(星期二) 下午2:50 @.>; @.@.>; 主题: Re: [PaddlePaddle/PaddleSeg] [设置GPU为1号卡,不生效] (Issue #2310)
建议先升级到paddleseg 2.5,然后看下是否还存在该问题。 该问题此前缺失没遇到过。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
windows上是:set CUDA_VISIBLE_DEVICES=1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.