mirror of
https://gitee.com/fastnlp/fastNLP.git
synced 2024-11-29 10:48:40 +08:00
修改ddp python -m a.b.c 启动时的错误
This commit is contained in:
parent
3aed436bb7
commit
24ca2851bb
@ -83,7 +83,7 @@ class FleetLauncher:
|
||||
# use the same python interpreter and actually running
|
||||
command = [sys.executable] + command
|
||||
else: # Script called as `python -m a.b.c`
|
||||
command = [sys.executable, "-m", __main__.__spec__._name] + sys.argv[1:]
|
||||
command = [sys.executable, "-m", __main__.__spec__.name] + sys.argv[1:]
|
||||
|
||||
current_env = copy.copy(self.global_envs)
|
||||
for idx, t in enumerate(self.sub_trainers):
|
||||
|
@ -425,7 +425,7 @@ class TorchDDPDriver(TorchDriver):
|
||||
command = [sys.executable] + command
|
||||
# Script called as `python -m a.b.c`
|
||||
else:
|
||||
command = [sys.executable, "-m", __main__.__spec__._name] + sys.argv[1:]
|
||||
command = [sys.executable, "-m", __main__.__spec__.name] + sys.argv[1:]
|
||||
|
||||
os.environ['MASTER_ADDR'] = self.master_address
|
||||
os.environ['MASTER_PORT'] = self.master_port
|
||||
|
Loading…
Reference in New Issue
Block a user