PaddleSeg icon indicating copy to clipboard operation
PaddleSeg copied to clipboard

[设置GPU为1号卡,不生效]

Open chenxi00a1 opened this issue 3 years ago • 12 comments

Thanks for your issue. To help us solve the issue better, please provide following information:

  1. PaddleSeg version:
  2. PaddleSeg version: (PaddleSeg release/2.3)
  3. PaddlePaddle version: (paddlepaddle-gpu 2.3.0)
  4. Operation system: (Linux)
  5. Python version: (Python3.6)
  6. CUDA/cuDNN version: (CUDA11.2)
  7. Additional context: (Add any other context about the problem) 在Linux上 单卡训练模型的时候( 有两张1080ti卡),可以看到0号卡在被使用,接下来x想设置1号卡来进行当下的训练 1657522949237

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

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

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


chenxi00a1 avatar Jul 11 '22 07:07 chenxi00a1

请您给出具体使用的paddleseg模型及使用方式,根据您目前提供的报错信息,可以参考如下文档:单卡训练及多卡训练的命令差异可参考https://github.com/PaddlePaddle/PaddleSeg/blob/release/2.5/docs/train/train_cn.md

haoyuying avatar Jul 11 '22 08:07 haoyuying

启动训练前执行: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号卡的操作并没有成功)

chenxi00a1 avatar Jul 11 '22 08:07 chenxi00a1

确实是有这个问题,我也是,都是使用 gpu:0

gg22mm avatar Jul 12 '22 05:07 gg22mm

建议先升级到paddleseg 2.5,然后看下是否还存在该问题。 该问题此前缺失没遇到过。

juncaipeng avatar Jul 12 '22 06:07 juncaipeng

是不是windows的问题,我用的是widows : set export CUDA_VISIBLE_DEVICES=1

gg22mm avatar Jul 12 '22 06:07 gg22mm

我是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: @.***>

chenxi00a1 avatar Jul 12 '22 06:07 chenxi00a1

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号卡上跑的

xiegegege avatar Jul 12 '22 07:07 xiegegege

谢谢,我也测试这个命令 它就不是在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: @.***>

chenxi00a1 avatar Jul 12 '22 07:07 chenxi00a1

测试这个命令 它就不是在1号卡跑 很奇怪 我想可能是widonws 问题,因为我用的是win10出问题,linux我没试,懒得配置,以后再说 , 你是windos or linux ?

gg22mm avatar Jul 12 '22 07:07 gg22mm

我一直用的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: @.***>

chenxi00a1 avatar Jul 12 '22 07:07 chenxi00a1

谢谢,好的 我做一下尝试。

------------------ 原始邮件 ------------------ 发件人: "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: @.***>

chenxi00a1 avatar Jul 13 '22 01:07 chenxi00a1

windows上是:set CUDA_VISIBLE_DEVICES=1

juncaipeng avatar Jul 18 '22 06:07 juncaipeng

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.

github-actions[bot] avatar Dec 10 '22 17:12 github-actions[bot]