forked from uni-medical/SAM-Med3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
train.py
35 lines (28 loc) · 835 Bytes
/
train.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import lightning as L
import torch
from segment_anything import NeuroSamModel
from utils.cli_utils import LoggerSaveConfigCallback, NeuroSAMCLI
from utils.data_module import NeuroSamDataModule
torch.set_float32_matmul_precision('medium')
def cli_main():
cli = NeuroSAMCLI(
NeuroSamModel,
NeuroSamDataModule,
seed_everything_default=2024,
save_config_callback=LoggerSaveConfigCallback,
save_config_kwargs={
"save_to_log_dir": True,
"overwrite": True,
},
parser_kwargs={
"parser_mode": "omegaconf",
"fit": {
"default_config_files": [
"configs/all.yaml",
]
}
},
auto_configure_optimizers=False,
)
if __name__ == "__main__":
cli_main()