Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行tran.py出现的问题 #51

Open
sure66-sda opened this issue Jul 16, 2024 · 4 comments
Open

运行tran.py出现的问题 #51

sure66-sda opened this issue Jul 16, 2024 · 4 comments

Comments

@sure66-sda
Copy link

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'

@sure66-sda
Copy link
Author

出现这个问题是哪个配置文件路径没调用吗,纯新手想复现一下

@zhengchen1999
Copy link
Owner

你训练的指令是什么,以及运行代码的硬件配置(GPU个数)。

@sure66-sda
Copy link
Author

你训练的指令是什么,以及运行代码的硬件配置(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

@zhengchen1999
Copy link
Owner

zhengchen1999 commented Jul 23, 2024

torchrun --nproc_per_node=4
修改为
torchrun --nproc_per_node=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants