| param( | |
| [string]$Config = "configs/train_2gpu_4090d.json", | |
| [int]$BatchSize = 10, | |
| [int]$Epochs = 500, | |
| [string]$Weights = "" | |
| ) | |
| $ErrorActionPreference = "Stop" | |
| $env:CUDA_VISIBLE_DEVICES = "0,1" | |
| $env:PYTHONUTF8 = "1" | |
| $env:USE_LIBUV = "0" | |
| $argsList = @( | |
| "scripts/launch_ddp_no_libuv.py", | |
| "--nproc_per_node=2", | |
| "--master_addr=127.0.0.1", | |
| "--master_port=29500", | |
| "train_seaweed_segmentation.py", | |
| "--config", $Config, | |
| "--batch-size", "$BatchSize", | |
| "--epochs", "$Epochs" | |
| ) | |
| if ($Weights -ne "") { | |
| $argsList += @("--weights", $Weights) | |
| } | |
| python @argsList | |