ultralytics 8.0.31 updates and fixes (#857)
Co-authored-by: Yonghye Kwon <developer.0hye@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kalen Michael <kalenmike@gmail.com>
This commit is contained in:
parent
2e7a533ac3
commit
f5d003d05a
9 changed files with 285 additions and 131 deletions
|
|
@ -7,6 +7,7 @@ import sys
|
|||
import tempfile
|
||||
|
||||
from . import USER_CONFIG_DIR
|
||||
from .torch_utils import TORCH_1_9
|
||||
|
||||
|
||||
def find_free_network_port() -> int:
|
||||
|
|
@ -47,8 +48,9 @@ def generate_ddp_command(world_size, trainer):
|
|||
using_cli = not file_name.endswith(".py")
|
||||
if using_cli:
|
||||
file_name = generate_ddp_file(trainer)
|
||||
torch_distributed_cmd = "torch.distributed.run" if TORCH_1_9 else "torch.distributed.launch"
|
||||
return [
|
||||
sys.executable, "-m", "torch.distributed.run", "--nproc_per_node", f"{world_size}", "--master_port",
|
||||
sys.executable, "-m", torch_distributed_cmd, "--nproc_per_node", f"{world_size}", "--master_port",
|
||||
f"{find_free_network_port()}", file_name] + sys.argv[1:]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue