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

分布式训练报错 #30

Open
ATun-cell opened this issue Sep 29, 2024 · 2 comments
Open

分布式训练报错 #30

ATun-cell opened this issue Sep 29, 2024 · 2 comments

Comments

@ATun-cell
Copy link

Traceback (most recent call last):
File "/home/cvlab1045/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/pydevd.py", line 3489, in
main()
File "/home/cvlab1045/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/pydevd.py", line 3482, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/cvlab1045/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/pydevd.py", line 2510, in run
return self._exec(is_module, entry_point_fn, module_name, file, globals, locals)
File "/home/cvlab1045/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/pydevd.py", line 2517, in _exec
globals = pydevd_runpy.run_path(file, globals, 'main')
File "/home/cvlab1045/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path
return _run_module_code(code, init_globals, run_name,
File "/home/cvlab1045/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/home/cvlab1045/.vscode-server/extensions/ms-python.debugpy-2024.0.0-linux-x64/bundled/libs/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "main.py", line 197, in
main(config=update_config(config=cfg, option=opt))
File "main.py", line 179, in main
train(config=config, logger=logger)
File "/media/cvlab1045/D1/LJ/MOTIP-main/train_engine.py", line 102, in train
sampler_train.set_epoch(epoch)
File "/media/cvlab1045/D1/LJ/MOTIP-main/train_engine.py", line 340, in train_one_epoch

File "/media/cvlab1045/D1/LJ/media/cvlab1045/LJtrack/lib/python3.8/site-packages/torch/_tensor.py", line 396, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "/media/cvlab1045/D1/LJ/media/cvlab1045/LJtrack/lib/python3.8/site-packages/torch/autograd/init.py", line 173, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: Expected to mark a variable ready only once. This error is caused by one of the following reasons: 1) Use of a module parameter outside the forward function. Please make sure model parameters are not shared across multiple concurrent forward-backward passes. or try to use _set_static_graph() as a workaround if this module graph does not change during training loop.2) Reused parameters in multiple reentrant backward passes. For example, if you use multiple checkpoint functions to wrap the same part of your model, it would result in the same set of parameters been used by different reentrant backward passes multiple times, and hence marking a variable ready multiple times. DDP does not support such use cases in default. You can try to use _set_static_graph() as a workaround if your module graph does not change over iterations.
Parameter at index 352 with name seq_decoder.id_decoder.embed_to_word.weight has been marked as ready twice. This means that multiple autograd engine hooks have fired for this particular parameter during this iteration.
seq_decoder.id_decoder.embed_to_word.weight显示是这一层的权重在多进程训练时存在问题,麻烦大佬帮我看一下

@ATun-cell
Copy link
Author

Snipaste_2024-09-29_17-05-01
您MOT17预训练用的数据是MOT17+ch, 但是如果用完整的数据集不应该是您提供的log文件中3717这么少吧,是不是舍弃了一部分数据呢

@HELLORPG
Copy link
Collaborator

HELLORPG commented Oct 1, 2024

在我们公开的代码中,分布式训练是没有这个错误的,考虑是否是版本问题或是开启了 find_unused_parameters 参数。
关于第二个问题,在我们的文档中有介绍,我们去除了 MOT17 中的重复数据。

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