单卡训练报错ValueError: paddle.distributed initialize error, environment variable FLAGS_selected_gpus is needed, but not set.

ukqbszuj  于 3个月前  发布在  其他
关注(0)|答案(1)|浏览(44)

bug描述 Describe the Bug

启动命令
export CUDA_VISIBLE_DEVICES=1
python3.7 tools/train.py -c ./ppcls/configs/car/car_poolformer_tricks_v15_re3.yaml
环境信息
Python 3.7.0
CUDA Version: 11.4
GPU: V100
paddle: 2.4.1
报错信息
Traceback (most recent call last):
File "tools/train.py", line 31, in
engine = Engine(config, mode="train")
File "/root/paddlejob/workspace/env_run/xxx/ppcls/engine/engine.py", line 231, in init
dist.init_parallel_env()
File "/usr/local/lib/python3.7/site-packages/paddle/distributed/parallel.py", line 197, in init_parallel_env
_check_var_exists("FLAGS_selected_gpus")
File "/usr/local/lib/python3.7/site-packages/paddle/distributed/parallel.py", line 100, in _check_var_exists
"environment variable %s is needed, but not set." % var_name
ValueError: paddle.distributed initialize error, environment variable FLAGS_selected_gpus is needed, but not set.

其他补充信息 Additional Supplementary Information

No response

nlejzf6q

nlejzf6q1#

您好 请设置环境变量 指定哪些 GPU 被选中用于训练 例如 export FLAGS_selected_gpus=1

相关问题