Update main.py
Browse files
main.py
CHANGED
@@ -11,16 +11,24 @@ def run_transfer_learning(dataset, epochs, batch_size, imgsz, patience, cache, p
|
|
11 |
"--imgsz", str(imgsz),
|
12 |
"--patience", str(patience),
|
13 |
"--cache", cache,
|
14 |
-
"--pretrained", str(pretrained),
|
15 |
-
"--cos_lr", str(cos_lr),
|
16 |
-
"--profile", str(profile),
|
17 |
-
"--plots", str(plots),
|
18 |
-
"--resume", str(resume),
|
19 |
-
"--augment", str(augment),
|
20 |
"--model", model,
|
21 |
"--run", run
|
22 |
]
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
# Use subprocess to run the script with the arguments
|
25 |
subprocess.run(command, check=True)
|
26 |
|
|
|
11 |
"--imgsz", str(imgsz),
|
12 |
"--patience", str(patience),
|
13 |
"--cache", cache,
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
"--model", model,
|
15 |
"--run", run
|
16 |
]
|
17 |
|
18 |
+
# Add boolean flags only if they are True
|
19 |
+
if pretrained:
|
20 |
+
command.append("--pretrained")
|
21 |
+
if cos_lr:
|
22 |
+
command.append("--cos_lr")
|
23 |
+
if profile:
|
24 |
+
command.append("--profile")
|
25 |
+
if plots:
|
26 |
+
command.append("--plots")
|
27 |
+
if resume:
|
28 |
+
command.append("--resume")
|
29 |
+
if augment:
|
30 |
+
command.append("--augment")
|
31 |
+
|
32 |
# Use subprocess to run the script with the arguments
|
33 |
subprocess.run(command, check=True)
|
34 |
|