运行tran.py出现的问题
sure66-sda opened this issue · 4 comments
File "D:/pycharm/PyCharm Community Edition 2022.3.3/plugins/python-ce/helpers/pydev/pydevd.py", line 1496, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\pycharm\PyCharm Community Edition 2022.3.3\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:\lunwen\DAT-main\basicsr\train.py", line 215, in
train_pipeline(root_path)
File "D:\lunwen\DAT-main\basicsr\train.py", line 93, in train_pipeline
opt, args = parse_options(root_path, is_train=True)
File "D:\lunwen\DAT-main\basicsr\utils\options.py", line 106, in parse_options
init_dist(args.launcher)
File "D:\lunwen\DAT-main\basicsr\utils\dist_util.py", line 14, in init_dist
_init_dist_pytorch(backend, **kwargs)
File "D:\lunwen\DAT-main\basicsr\utils\dist_util.py", line 22, in _init_dist_pytorch
rank = int(os.environ['RANK'])
File "D:\anaconda3\envs\lld\lib\os.py", line 675, in getitem
raise KeyError(key) from None
KeyError: 'RANK'
出现这个问题是哪个配置文件路径没调用吗,纯新手想复现一下
你训练的指令是什么,以及运行代码的硬件配置(GPU个数)。
你训练的指令是什么,以及运行代码的硬件配置(GPU个数)。
torchrun --nproc_per_node=4 --nnodes=1 --node_rank=0 --master_addr="127.0.0.1" --master_port=29500 D:/lunwen/DAT-main/basicsr/train.py -opt D:\lunwen\DAT-main\basicsr\train_DAT_2_x2.yml
gpu的话只有一个4060
torchrun --nproc_per_node=4
修改为
torchrun --nproc_per_node=1