-
Notifications
You must be signed in to change notification settings - Fork 232
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
双卡训练报错:ModuleNotFoundError: No module named 'mmengine' #324
Comments
请查看
|
torchrun 没有被找到
|
但是这个torchrun --help命令是可以用的,但pip list 显示没有 torchrun |
查看一下虚拟环境的bin内有没有torchrun
|
先休息了佬 |
test.py
命令:
查看一下打印出来的 python 路径是哪一个? |
|
@KMnO4-zx |
好的 感谢~ |
您好,我也遇到了同样的问题,请问解决了吗 |
@kikyzzz 尝试执行这一步骤,验证 torchrun 所执行的 python 路径 |
您好,我这里显示的是:/home/wangbenzhi/miniconda3/envs/disco/bin/python
/home/wangbenzhi/miniconda3/envs/disco/bin/python
确实并不是我的项目在的虚拟环境里,我的虚拟环境的/home/wangbenzhi/miniconda3/envs/project/bin/python
…------------------ 原始邮件 ------------------
发件人: "InternLM/xtuner" ***@***.***>;
发送时间: 2024年3月13日(星期三) 晚上7:55
***@***.***>;
***@***.******@***.***>;
主题: Re: [InternLM/xtuner] 双卡训练报错:ModuleNotFoundError: No module named 'mmengine' (Issue #324)
test.py
import sys print(sys.executable)
命令:
torchrun --nnodes=1 --nproc_per_node=2 --master_port=29666 test.py
查看一下打印出来的 python 路径是哪一个?
@kikyzzz 尝试执行这一步骤,验证 torchrun 所执行的 python 路径
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@kikyzzz 这个问题的根源,就是当前环境的 torchrun 调用了其他环境的 python。可以执行下面这个命令查看一下 torchrun 的实际运行代码
|
非常感谢您,我已经明白这个问题出在哪里了,但是我太懂这些操作系统的指令,我查看了torchrun文件,里面的内容是:
import sys from torch.distributed.run import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(main())
我该如何修改它呢
…------------------ 原始邮件 ------------------
发件人: "InternLM/xtuner" ***@***.***>;
发送时间: 2024年3月13日(星期三) 晚上8:10
***@***.***>;
***@***.******@***.***>;
主题: Re: [InternLM/xtuner] 双卡训练报错:ModuleNotFoundError: No module named 'mmengine' (Issue #324)
@kikyzzz 这个问题的根源,就是当前环境的 torchrun 调用了其他环境的 python。可以执行下面这个命令查看一下 torchrun 的实际运行代码
cat /home/wangbenzhi/miniconda3/envs/project/bin/torchrun
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@kikyzzz
|
我这里上面的路劲好像也是我现在虚拟环境下的正确路径欸,
#!/home/wangbenzhi/miniconda3/envs/project/bin/python
# -*- coding: utf-8 -*-
import re
import sys
from torch.distributed.run import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
sys.exit(main())
…------------------ 原始邮件 ------------------
发件人: "InternLM/xtuner" ***@***.***>;
发送时间: 2024年3月13日(星期三) 晚上8:26
***@***.***>;
***@***.******@***.***>;
主题: Re: [InternLM/xtuner] 双卡训练报错:ModuleNotFoundError: No module named 'mmengine' (Issue #324)
@kikyzzz
我这边是这样的,开头有一个可执行文件的指定
#!/xxxx/bin/python # -*- coding: utf-8 -*- import re import sys from torch.distributed.run import main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(main())
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@kikyzzz where torchrun |
在使用xtuner0.1.9 双卡(A100*2) deepspeed 全量微调InternLM-7b-chat的时候遇到了
ModuleNotFoundError: No module named 'mmengine'
这个问题。使用单卡(A100)可以正常加载模型不会报错,但会OOM。使用的命令为:
以下是报错信息:
config脚本为:
The text was updated successfully, but these errors were encountered: