Spaces:
Runtime error
Runtime error
Soutrik
commited on
Commit
Β·
4ff4028
1
Parent(s):
dcb5590
basic testing of configs , remove targets for callbacks and loggers
Browse files- configs/callbacks/default.yaml +4 -1
- configs/callbacks/early_stopping.yaml +0 -1
- configs/callbacks/model_checkpoint.yaml +0 -1
- configs/callbacks/model_summary.yaml +1 -2
- configs/callbacks/rich_progress_bar.yaml +1 -1
- configs/experiment/catdog_experiment.yaml +8 -0
- configs/logger/aim.yaml +0 -1
- configs/logger/csv.yaml +0 -1
- configs/logger/default.yaml +1 -3
- configs/logger/mlflow.yaml +0 -1
- configs/logger/tensorboard.yaml +0 -1
- configs/model/catdog_classifier.yaml +2 -1
- configs/train.yaml +1 -1
- logs/train/runs/{2024-11-08_14-32-38 β 2024-11-08_15-27-10}/.hydra/config.yaml +3 -21
- logs/train/runs/{2024-11-08_14-29-05 β 2024-11-08_15-27-10}/.hydra/hydra.yaml +3 -3
- logs/train/runs/{2024-11-08_14-29-05 β 2024-11-08_15-27-10}/.hydra/overrides.yaml +0 -0
- logs/train/runs/{2024-11-08_14-29-05 β 2024-11-08_15-27-10}/train.log +0 -0
- logs/train/runs/{2024-11-08_14-29-05 β 2024-11-08_15-29-07}/.hydra/config.yaml +5 -22
- logs/train/runs/{2024-11-08_14-32-38 β 2024-11-08_15-29-07}/.hydra/hydra.yaml +3 -3
- logs/train/runs/{2024-11-08_14-32-38 β 2024-11-08_15-29-07}/.hydra/overrides.yaml +0 -0
- logs/train/runs/{2024-11-08_14-32-38 β 2024-11-08_15-29-07}/train.log +0 -0
- logs/train/runs/2024-11-08_15-29-42/.hydra/config.yaml +95 -0
- logs/train/runs/2024-11-08_15-29-42/.hydra/hydra.yaml +174 -0
- logs/train/runs/2024-11-08_15-29-42/.hydra/overrides.yaml +1 -0
- logs/train/runs/2024-11-08_15-29-42/train.log +0 -0
- logs/train/runs/2024-11-08_15-30-22/.hydra/config.yaml +95 -0
- logs/train/runs/2024-11-08_15-30-22/.hydra/hydra.yaml +174 -0
- logs/train/runs/2024-11-08_15-30-22/.hydra/overrides.yaml +1 -0
- logs/train/runs/2024-11-08_15-30-22/train.log +0 -0
- logs/train/runs/2024-11-08_15-35-40/.hydra/config.yaml +95 -0
- logs/train/runs/2024-11-08_15-35-40/.hydra/hydra.yaml +174 -0
- logs/train/runs/2024-11-08_15-35-40/.hydra/overrides.yaml +1 -0
- logs/train/runs/2024-11-08_15-35-40/train.log +0 -0
- logs/train/runs/2024-11-08_15-35-57/.hydra/config.yaml +95 -0
- logs/train/runs/2024-11-08_15-35-57/.hydra/hydra.yaml +174 -0
- logs/train/runs/2024-11-08_15-35-57/.hydra/overrides.yaml +1 -0
- logs/train/runs/2024-11-08_15-35-57/train.log +0 -0
- logs/train/runs/2024-11-08_15-37-45/.hydra/config.yaml +95 -0
- logs/train/runs/2024-11-08_15-37-45/.hydra/hydra.yaml +174 -0
- logs/train/runs/2024-11-08_15-37-45/.hydra/overrides.yaml +1 -0
- logs/train/runs/2024-11-08_15-37-45/train.log +0 -0
- src/hydra_test.py +60 -0
- src/hydra_test2.py +68 -0
- src/models/catdog_model.py +119 -0
- src/utils/logging_utils.py +45 -0
configs/callbacks/default.yaml
CHANGED
@@ -18,4 +18,7 @@ early_stopping:
|
|
18 |
mode: "min"
|
19 |
|
20 |
model_summary:
|
21 |
-
max_depth: -1
|
|
|
|
|
|
|
|
18 |
mode: "min"
|
19 |
|
20 |
model_summary:
|
21 |
+
max_depth: -1
|
22 |
+
|
23 |
+
rich_progress_bar:
|
24 |
+
refresh_rate: 1
|
configs/callbacks/early_stopping.yaml
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
# https://lightning.ai/docs/pytorch/stable/api/lightning.pytorch.callbacks.EarlyStopping.html
|
2 |
|
3 |
early_stopping:
|
4 |
-
_target_: lightning.pytorch.callbacks.EarlyStopping
|
5 |
monitor: val_loss # quantity to be monitored, must be specified !!!
|
6 |
min_delta: 0. # minimum change in the monitored quantity to qualify as an improvement
|
7 |
patience: 3 # number of checks with no improvement after which training will be stopped
|
|
|
1 |
# https://lightning.ai/docs/pytorch/stable/api/lightning.pytorch.callbacks.EarlyStopping.html
|
2 |
|
3 |
early_stopping:
|
|
|
4 |
monitor: val_loss # quantity to be monitored, must be specified !!!
|
5 |
min_delta: 0. # minimum change in the monitored quantity to qualify as an improvement
|
6 |
patience: 3 # number of checks with no improvement after which training will be stopped
|
configs/callbacks/model_checkpoint.yaml
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
# https://lightning.ai/docs/pytorch/stable/api/lightning.pytorch.callbacks.ModelCheckpoint.html
|
2 |
|
3 |
model_checkpoint:
|
4 |
-
_target_: lightning.pytorch.callbacks.ModelCheckpoint
|
5 |
dirpath: null # directory to save the model file
|
6 |
filename: best-checkpoint # checkpoint filename
|
7 |
monitor: val_loss # name of the logged metric which determines when model is improving
|
|
|
1 |
# https://lightning.ai/docs/pytorch/stable/api/lightning.pytorch.callbacks.ModelCheckpoint.html
|
2 |
|
3 |
model_checkpoint:
|
|
|
4 |
dirpath: null # directory to save the model file
|
5 |
filename: best-checkpoint # checkpoint filename
|
6 |
monitor: val_loss # name of the logged metric which determines when model is improving
|
configs/callbacks/model_summary.yaml
CHANGED
@@ -1,3 +1,2 @@
|
|
1 |
model_summary:
|
2 |
-
|
3 |
-
max_depth: 2
|
|
|
1 |
model_summary:
|
2 |
+
max_depth: 1
|
|
configs/callbacks/rich_progress_bar.yaml
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
rich_progress_bar:
|
2 |
-
|
|
|
1 |
rich_progress_bar:
|
2 |
+
refresh_rate: 1
|
configs/experiment/catdog_experiment.yaml
CHANGED
@@ -46,8 +46,16 @@ callbacks:
|
|
46 |
mode: "max"
|
47 |
save_top_k: 1
|
48 |
save_last: True
|
|
|
49 |
|
50 |
early_stopping:
|
51 |
monitor: "val_acc"
|
52 |
patience: 10
|
53 |
mode: "max"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
mode: "max"
|
47 |
save_top_k: 1
|
48 |
save_last: True
|
49 |
+
verbose: True
|
50 |
|
51 |
early_stopping:
|
52 |
monitor: "val_acc"
|
53 |
patience: 10
|
54 |
mode: "max"
|
55 |
+
verbose: True
|
56 |
+
|
57 |
+
model_summary:
|
58 |
+
max_depth: 1
|
59 |
+
|
60 |
+
rich_progress_bar:
|
61 |
+
refresh_rate: 1
|
configs/logger/aim.yaml
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
aim:
|
2 |
-
__target__: aim.pytorch_lightning.AimLogger
|
3 |
experiment: ${name}
|
4 |
train_metric_prefix: train_
|
5 |
test_metric_prefix: test_
|
|
|
1 |
aim:
|
|
|
2 |
experiment: ${name}
|
3 |
train_metric_prefix: train_
|
4 |
test_metric_prefix: test_
|
configs/logger/csv.yaml
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
# csv logger built in lightning
|
2 |
|
3 |
csv:
|
4 |
-
_target_: lightning.pytorch.loggers.csv_logs.CSVLogger
|
5 |
save_dir: "${paths.output_dir}"
|
6 |
name: "csv/"
|
7 |
prefix: ""
|
|
|
1 |
# csv logger built in lightning
|
2 |
|
3 |
csv:
|
|
|
4 |
save_dir: "${paths.output_dir}"
|
5 |
name: "csv/"
|
6 |
prefix: ""
|
configs/logger/default.yaml
CHANGED
@@ -2,6 +2,4 @@
|
|
2 |
|
3 |
defaults:
|
4 |
- csv
|
5 |
-
- tensorboard
|
6 |
-
- aim
|
7 |
-
- mlflow
|
|
|
2 |
|
3 |
defaults:
|
4 |
- csv
|
5 |
+
- tensorboard
|
|
|
|
configs/logger/mlflow.yaml
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
# MLflow logger configuration
|
2 |
|
3 |
mlflow:
|
4 |
-
_target_: lightning.pytorch.loggers.MLFlowLogger
|
5 |
experiment_name: ${name}
|
6 |
tracking_uri: file:${paths.log_dir}/mlruns
|
7 |
save_dir: ${paths.log_dir}/mlruns
|
|
|
1 |
# MLflow logger configuration
|
2 |
|
3 |
mlflow:
|
|
|
4 |
experiment_name: ${name}
|
5 |
tracking_uri: file:${paths.log_dir}/mlruns
|
6 |
save_dir: ${paths.log_dir}/mlruns
|
configs/logger/tensorboard.yaml
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
# https://www.tensorflow.org/tensorboard/
|
2 |
|
3 |
tensorboard:
|
4 |
-
_target_: lightning.pytorch.loggers.tensorboard.TensorBoardLogger
|
5 |
save_dir: "${paths.output_dir}/tensorboard/"
|
6 |
name: null
|
7 |
log_graph: False
|
|
|
1 |
# https://www.tensorflow.org/tensorboard/
|
2 |
|
3 |
tensorboard:
|
|
|
4 |
save_dir: "${paths.output_dir}/tensorboard/"
|
5 |
name: null
|
6 |
log_graph: False
|
configs/model/catdog_classifier.yaml
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
|
2 |
-
|
|
|
3 |
|
4 |
# model params
|
5 |
img_size: 160
|
|
|
1 |
|
2 |
+
# model class
|
3 |
+
_target_: src.models.catdog_model.ViTTinyClassifier
|
4 |
|
5 |
# model params
|
6 |
img_size: 160
|
configs/train.yaml
CHANGED
@@ -7,7 +7,7 @@ defaults:
|
|
7 |
- data: catdog
|
8 |
- model: catdog_classifier
|
9 |
- callbacks: default
|
10 |
-
- logger:
|
11 |
- trainer: default
|
12 |
- paths: catdog
|
13 |
- hydra: default
|
|
|
7 |
- data: catdog
|
8 |
- model: catdog_classifier
|
9 |
- callbacks: default
|
10 |
+
- logger: default # set logger here or use command line (e.g. `python train.py logger=tensorboard`)
|
11 |
- trainer: default
|
12 |
- paths: catdog
|
13 |
- hydra: default
|
logs/train/runs/{2024-11-08_14-32-38 β 2024-11-08_15-27-10}/.hydra/config.yaml
RENAMED
@@ -19,7 +19,7 @@ data:
|
|
19 |
image_size: 160
|
20 |
dataset_url: https://download.pytorch.org/tutorials/cats_and_dogs_filtered.zip
|
21 |
model:
|
22 |
-
_target_: src.models.
|
23 |
img_size: 160
|
24 |
patch_size: 16
|
25 |
num_classes: 2
|
@@ -35,7 +35,6 @@ model:
|
|
35 |
min_lr: 1.0e-06
|
36 |
callbacks:
|
37 |
model_checkpoint:
|
38 |
-
_target_: lightning.pytorch.callbacks.ModelCheckpoint
|
39 |
dirpath: ${paths.ckpt_dir}
|
40 |
filename: best-checkpoint
|
41 |
monitor: val_acc
|
@@ -50,7 +49,6 @@ callbacks:
|
|
50 |
every_n_epochs: null
|
51 |
save_on_train_epoch_end: null
|
52 |
early_stopping:
|
53 |
-
_target_: lightning.pytorch.callbacks.EarlyStopping
|
54 |
monitor: val_acc
|
55 |
min_delta: 0.0
|
56 |
patience: 10
|
@@ -62,36 +60,20 @@ callbacks:
|
|
62 |
divergence_threshold: null
|
63 |
check_on_train_epoch_end: null
|
64 |
model_summary:
|
65 |
-
|
66 |
-
max_depth: -1
|
67 |
rich_progress_bar:
|
68 |
-
|
69 |
logger:
|
70 |
csv:
|
71 |
-
_target_: lightning.pytorch.loggers.csv_logs.CSVLogger
|
72 |
save_dir: ${paths.output_dir}
|
73 |
name: csv/
|
74 |
prefix: ''
|
75 |
tensorboard:
|
76 |
-
_target_: lightning.pytorch.loggers.tensorboard.TensorBoardLogger
|
77 |
save_dir: ${paths.output_dir}/tensorboard/
|
78 |
name: null
|
79 |
log_graph: false
|
80 |
default_hp_metric: true
|
81 |
prefix: ''
|
82 |
-
aim:
|
83 |
-
__target__: aim.pytorch_lightning.AimLogger
|
84 |
-
experiment: ${name}
|
85 |
-
train_metric_prefix: train_
|
86 |
-
test_metric_prefix: test_
|
87 |
-
val_metric_prefix: val_
|
88 |
-
mlflow:
|
89 |
-
_target_: lightning.pytorch.loggers.MLFlowLogger
|
90 |
-
experiment_name: ${name}
|
91 |
-
tracking_uri: file:${paths.log_dir}/mlruns
|
92 |
-
save_dir: ${paths.log_dir}/mlruns
|
93 |
-
log_model: false
|
94 |
-
prefix: ''
|
95 |
trainer:
|
96 |
_target_: lightning.Trainer
|
97 |
default_root_dir: ${paths.output_dir}
|
|
|
19 |
image_size: 160
|
20 |
dataset_url: https://download.pytorch.org/tutorials/cats_and_dogs_filtered.zip
|
21 |
model:
|
22 |
+
_target_: src.models.catdog_model.ViTTinyClassifier
|
23 |
img_size: 160
|
24 |
patch_size: 16
|
25 |
num_classes: 2
|
|
|
35 |
min_lr: 1.0e-06
|
36 |
callbacks:
|
37 |
model_checkpoint:
|
|
|
38 |
dirpath: ${paths.ckpt_dir}
|
39 |
filename: best-checkpoint
|
40 |
monitor: val_acc
|
|
|
49 |
every_n_epochs: null
|
50 |
save_on_train_epoch_end: null
|
51 |
early_stopping:
|
|
|
52 |
monitor: val_acc
|
53 |
min_delta: 0.0
|
54 |
patience: 10
|
|
|
60 |
divergence_threshold: null
|
61 |
check_on_train_epoch_end: null
|
62 |
model_summary:
|
63 |
+
max_depth: 1
|
|
|
64 |
rich_progress_bar:
|
65 |
+
refresh_rate: 1
|
66 |
logger:
|
67 |
csv:
|
|
|
68 |
save_dir: ${paths.output_dir}
|
69 |
name: csv/
|
70 |
prefix: ''
|
71 |
tensorboard:
|
|
|
72 |
save_dir: ${paths.output_dir}/tensorboard/
|
73 |
name: null
|
74 |
log_graph: false
|
75 |
default_hp_metric: true
|
76 |
prefix: ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
trainer:
|
78 |
_target_: lightning.Trainer
|
79 |
default_root_dir: ${paths.output_dir}
|
logs/train/runs/{2024-11-08_14-29-05 β 2024-11-08_15-27-10}/.hydra/hydra.yaml
RENAMED
@@ -121,7 +121,7 @@ hydra:
|
|
121 |
- hydra.mode=RUN
|
122 |
task: []
|
123 |
job:
|
124 |
-
name:
|
125 |
chdir: null
|
126 |
override_dirname: ''
|
127 |
id: ???
|
@@ -136,7 +136,7 @@ hydra:
|
|
136 |
exclude_keys: []
|
137 |
runtime:
|
138 |
version: 1.3.2
|
139 |
-
version_base: '1.
|
140 |
cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws
|
141 |
config_sources:
|
142 |
- path: hydra.conf
|
@@ -151,7 +151,7 @@ hydra:
|
|
151 |
- path: ''
|
152 |
schema: structured
|
153 |
provider: schema
|
154 |
-
output_dir: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/logs/train/runs/2024-11-
|
155 |
choices:
|
156 |
debug: null
|
157 |
experiment: catdog_experiment
|
|
|
121 |
- hydra.mode=RUN
|
122 |
task: []
|
123 |
job:
|
124 |
+
name: hydra_test
|
125 |
chdir: null
|
126 |
override_dirname: ''
|
127 |
id: ???
|
|
|
136 |
exclude_keys: []
|
137 |
runtime:
|
138 |
version: 1.3.2
|
139 |
+
version_base: '1.1'
|
140 |
cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws
|
141 |
config_sources:
|
142 |
- path: hydra.conf
|
|
|
151 |
- path: ''
|
152 |
schema: structured
|
153 |
provider: schema
|
154 |
+
output_dir: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/logs/train/runs/2024-11-08_15-27-10
|
155 |
choices:
|
156 |
debug: null
|
157 |
experiment: catdog_experiment
|
logs/train/runs/{2024-11-08_14-29-05 β 2024-11-08_15-27-10}/.hydra/overrides.yaml
RENAMED
File without changes
|
logs/train/runs/{2024-11-08_14-29-05 β 2024-11-08_15-27-10}/train.log
RENAMED
File without changes
|
logs/train/runs/{2024-11-08_14-29-05 β 2024-11-08_15-29-07}/.hydra/config.yaml
RENAMED
@@ -12,13 +12,14 @@ data:
|
|
12 |
url: ${paths.data_url}
|
13 |
num_workers: 8
|
14 |
batch_size: 64
|
15 |
-
|
16 |
- 0.8
|
17 |
- 0.2
|
18 |
pin_memory: true
|
19 |
image_size: 160
|
|
|
20 |
model:
|
21 |
-
_target_: src.models.
|
22 |
img_size: 160
|
23 |
patch_size: 16
|
24 |
num_classes: 2
|
@@ -34,7 +35,6 @@ model:
|
|
34 |
min_lr: 1.0e-06
|
35 |
callbacks:
|
36 |
model_checkpoint:
|
37 |
-
_target_: lightning.pytorch.callbacks.ModelCheckpoint
|
38 |
dirpath: ${paths.ckpt_dir}
|
39 |
filename: best-checkpoint
|
40 |
monitor: val_acc
|
@@ -49,7 +49,6 @@ callbacks:
|
|
49 |
every_n_epochs: null
|
50 |
save_on_train_epoch_end: null
|
51 |
early_stopping:
|
52 |
-
_target_: lightning.pytorch.callbacks.EarlyStopping
|
53 |
monitor: val_acc
|
54 |
min_delta: 0.0
|
55 |
patience: 10
|
@@ -61,36 +60,20 @@ callbacks:
|
|
61 |
divergence_threshold: null
|
62 |
check_on_train_epoch_end: null
|
63 |
model_summary:
|
64 |
-
|
65 |
-
max_depth: -1
|
66 |
rich_progress_bar:
|
67 |
-
|
68 |
logger:
|
69 |
csv:
|
70 |
-
_target_: lightning.pytorch.loggers.csv_logs.CSVLogger
|
71 |
save_dir: ${paths.output_dir}
|
72 |
name: csv/
|
73 |
prefix: ''
|
74 |
tensorboard:
|
75 |
-
_target_: lightning.pytorch.loggers.tensorboard.TensorBoardLogger
|
76 |
save_dir: ${paths.output_dir}/tensorboard/
|
77 |
name: null
|
78 |
log_graph: false
|
79 |
default_hp_metric: true
|
80 |
prefix: ''
|
81 |
-
aim:
|
82 |
-
__target__: aim.pytorch_lightning.AimLogger
|
83 |
-
experiment: ${name}
|
84 |
-
train_metric_prefix: train_
|
85 |
-
test_metric_prefix: test_
|
86 |
-
val_metric_prefix: val_
|
87 |
-
mlflow:
|
88 |
-
_target_: lightning.pytorch.loggers.MLFlowLogger
|
89 |
-
experiment_name: ${name}
|
90 |
-
tracking_uri: file:${paths.log_dir}/mlruns
|
91 |
-
save_dir: ${paths.log_dir}/mlruns
|
92 |
-
log_model: false
|
93 |
-
prefix: ''
|
94 |
trainer:
|
95 |
_target_: lightning.Trainer
|
96 |
default_root_dir: ${paths.output_dir}
|
|
|
12 |
url: ${paths.data_url}
|
13 |
num_workers: 8
|
14 |
batch_size: 64
|
15 |
+
train_val_split:
|
16 |
- 0.8
|
17 |
- 0.2
|
18 |
pin_memory: true
|
19 |
image_size: 160
|
20 |
+
dataset_url: https://download.pytorch.org/tutorials/cats_and_dogs_filtered.zip
|
21 |
model:
|
22 |
+
_target_: src.models.catdog_model.ViTTinyClassifier
|
23 |
img_size: 160
|
24 |
patch_size: 16
|
25 |
num_classes: 2
|
|
|
35 |
min_lr: 1.0e-06
|
36 |
callbacks:
|
37 |
model_checkpoint:
|
|
|
38 |
dirpath: ${paths.ckpt_dir}
|
39 |
filename: best-checkpoint
|
40 |
monitor: val_acc
|
|
|
49 |
every_n_epochs: null
|
50 |
save_on_train_epoch_end: null
|
51 |
early_stopping:
|
|
|
52 |
monitor: val_acc
|
53 |
min_delta: 0.0
|
54 |
patience: 10
|
|
|
60 |
divergence_threshold: null
|
61 |
check_on_train_epoch_end: null
|
62 |
model_summary:
|
63 |
+
max_depth: 1
|
|
|
64 |
rich_progress_bar:
|
65 |
+
refresh_rate: 1
|
66 |
logger:
|
67 |
csv:
|
|
|
68 |
save_dir: ${paths.output_dir}
|
69 |
name: csv/
|
70 |
prefix: ''
|
71 |
tensorboard:
|
|
|
72 |
save_dir: ${paths.output_dir}/tensorboard/
|
73 |
name: null
|
74 |
log_graph: false
|
75 |
default_hp_metric: true
|
76 |
prefix: ''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
trainer:
|
78 |
_target_: lightning.Trainer
|
79 |
default_root_dir: ${paths.output_dir}
|
logs/train/runs/{2024-11-08_14-32-38 β 2024-11-08_15-29-07}/.hydra/hydra.yaml
RENAMED
@@ -121,7 +121,7 @@ hydra:
|
|
121 |
- hydra.mode=RUN
|
122 |
task: []
|
123 |
job:
|
124 |
-
name:
|
125 |
chdir: null
|
126 |
override_dirname: ''
|
127 |
id: ???
|
@@ -136,7 +136,7 @@ hydra:
|
|
136 |
exclude_keys: []
|
137 |
runtime:
|
138 |
version: 1.3.2
|
139 |
-
version_base: '1.
|
140 |
cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws
|
141 |
config_sources:
|
142 |
- path: hydra.conf
|
@@ -151,7 +151,7 @@ hydra:
|
|
151 |
- path: ''
|
152 |
schema: structured
|
153 |
provider: schema
|
154 |
-
output_dir: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/logs/train/runs/2024-11-
|
155 |
choices:
|
156 |
debug: null
|
157 |
experiment: catdog_experiment
|
|
|
121 |
- hydra.mode=RUN
|
122 |
task: []
|
123 |
job:
|
124 |
+
name: hydra_test
|
125 |
chdir: null
|
126 |
override_dirname: ''
|
127 |
id: ???
|
|
|
136 |
exclude_keys: []
|
137 |
runtime:
|
138 |
version: 1.3.2
|
139 |
+
version_base: '1.1'
|
140 |
cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws
|
141 |
config_sources:
|
142 |
- path: hydra.conf
|
|
|
151 |
- path: ''
|
152 |
schema: structured
|
153 |
provider: schema
|
154 |
+
output_dir: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/logs/train/runs/2024-11-08_15-29-07
|
155 |
choices:
|
156 |
debug: null
|
157 |
experiment: catdog_experiment
|
logs/train/runs/{2024-11-08_14-32-38 β 2024-11-08_15-29-07}/.hydra/overrides.yaml
RENAMED
File without changes
|
logs/train/runs/{2024-11-08_14-32-38 β 2024-11-08_15-29-07}/train.log
RENAMED
File without changes
|
logs/train/runs/2024-11-08_15-29-42/.hydra/config.yaml
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
task_name: train
|
2 |
+
tags:
|
3 |
+
- dev
|
4 |
+
train: true
|
5 |
+
test: false
|
6 |
+
ckpt_path: ${paths.ckpt_dir}/best-checkpoint.ckpt
|
7 |
+
seed: 42
|
8 |
+
name: catdog_experiment
|
9 |
+
data:
|
10 |
+
_target_: src.datamodules.catdog_datamodule.CatDogImageDataModule
|
11 |
+
data_dir: ${paths.data_dir}
|
12 |
+
url: ${paths.data_url}
|
13 |
+
num_workers: 8
|
14 |
+
batch_size: 64
|
15 |
+
train_val_split:
|
16 |
+
- 0.8
|
17 |
+
- 0.2
|
18 |
+
pin_memory: true
|
19 |
+
image_size: 160
|
20 |
+
dataset_url: https://download.pytorch.org/tutorials/cats_and_dogs_filtered.zip
|
21 |
+
model:
|
22 |
+
_target_: src.models.catdog_model.ViTTinyClassifier
|
23 |
+
img_size: 160
|
24 |
+
patch_size: 16
|
25 |
+
num_classes: 2
|
26 |
+
embed_dim: 64
|
27 |
+
depth: 6
|
28 |
+
num_heads: 2
|
29 |
+
mlp_ratio: 3
|
30 |
+
pre_norm: false
|
31 |
+
lr: 0.001
|
32 |
+
weight_decay: 1.0e-05
|
33 |
+
factor: 0.1
|
34 |
+
patience: 10
|
35 |
+
min_lr: 1.0e-06
|
36 |
+
callbacks:
|
37 |
+
model_checkpoint:
|
38 |
+
dirpath: ${paths.ckpt_dir}
|
39 |
+
filename: best-checkpoint
|
40 |
+
monitor: val_acc
|
41 |
+
verbose: false
|
42 |
+
save_last: true
|
43 |
+
save_top_k: 1
|
44 |
+
mode: max
|
45 |
+
auto_insert_metric_name: false
|
46 |
+
save_weights_only: false
|
47 |
+
every_n_train_steps: null
|
48 |
+
train_time_interval: null
|
49 |
+
every_n_epochs: null
|
50 |
+
save_on_train_epoch_end: null
|
51 |
+
early_stopping:
|
52 |
+
monitor: val_acc
|
53 |
+
min_delta: 0.0
|
54 |
+
patience: 10
|
55 |
+
verbose: false
|
56 |
+
mode: max
|
57 |
+
strict: true
|
58 |
+
check_finite: true
|
59 |
+
stopping_threshold: null
|
60 |
+
divergence_threshold: null
|
61 |
+
check_on_train_epoch_end: null
|
62 |
+
model_summary:
|
63 |
+
max_depth: 1
|
64 |
+
rich_progress_bar:
|
65 |
+
refresh_rate: 1
|
66 |
+
logger:
|
67 |
+
csv:
|
68 |
+
save_dir: ${paths.output_dir}
|
69 |
+
name: csv/
|
70 |
+
prefix: ''
|
71 |
+
tensorboard:
|
72 |
+
save_dir: ${paths.output_dir}/tensorboard/
|
73 |
+
name: null
|
74 |
+
log_graph: false
|
75 |
+
default_hp_metric: true
|
76 |
+
prefix: ''
|
77 |
+
trainer:
|
78 |
+
_target_: lightning.Trainer
|
79 |
+
default_root_dir: ${paths.output_dir}
|
80 |
+
min_epochs: 1
|
81 |
+
max_epochs: 6
|
82 |
+
accelerator: auto
|
83 |
+
devices: auto
|
84 |
+
deterministic: true
|
85 |
+
log_every_n_steps: 10
|
86 |
+
fast_dev_run: false
|
87 |
+
paths:
|
88 |
+
root_dir: ${oc.env:PROJECT_ROOT}
|
89 |
+
data_dir: ${paths.root_dir}/data/
|
90 |
+
log_dir: ${paths.root_dir}/logs/
|
91 |
+
ckpt_dir: ${paths.root_dir}/checkpoints
|
92 |
+
artifact_dir: ${paths.root_dir}/artifacts/
|
93 |
+
data_url: https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip
|
94 |
+
output_dir: ${hydra:runtime.output_dir}
|
95 |
+
work_dir: ${hydra:runtime.cwd}
|
logs/train/runs/2024-11-08_15-29-42/.hydra/hydra.yaml
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
hydra:
|
2 |
+
run:
|
3 |
+
dir: ${paths.log_dir}/${task_name}/runs/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
4 |
+
sweep:
|
5 |
+
dir: ${paths.log_dir}/${task_name}/multiruns/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
6 |
+
subdir: ${hydra.job.num}
|
7 |
+
launcher:
|
8 |
+
_target_: hydra._internal.core_plugins.basic_launcher.BasicLauncher
|
9 |
+
sweeper:
|
10 |
+
_target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
|
11 |
+
max_batch_size: null
|
12 |
+
params: null
|
13 |
+
help:
|
14 |
+
app_name: ${hydra.job.name}
|
15 |
+
header: '${hydra.help.app_name} is powered by Hydra.
|
16 |
+
|
17 |
+
'
|
18 |
+
footer: 'Powered by Hydra (https://hydra.cc)
|
19 |
+
|
20 |
+
Use --hydra-help to view Hydra specific help
|
21 |
+
|
22 |
+
'
|
23 |
+
template: '${hydra.help.header}
|
24 |
+
|
25 |
+
== Configuration groups ==
|
26 |
+
|
27 |
+
Compose your configuration from those groups (group=option)
|
28 |
+
|
29 |
+
|
30 |
+
$APP_CONFIG_GROUPS
|
31 |
+
|
32 |
+
|
33 |
+
== Config ==
|
34 |
+
|
35 |
+
Override anything in the config (foo.bar=value)
|
36 |
+
|
37 |
+
|
38 |
+
$CONFIG
|
39 |
+
|
40 |
+
|
41 |
+
${hydra.help.footer}
|
42 |
+
|
43 |
+
'
|
44 |
+
hydra_help:
|
45 |
+
template: 'Hydra (${hydra.runtime.version})
|
46 |
+
|
47 |
+
See https://hydra.cc for more info.
|
48 |
+
|
49 |
+
|
50 |
+
== Flags ==
|
51 |
+
|
52 |
+
$FLAGS_HELP
|
53 |
+
|
54 |
+
|
55 |
+
== Configuration groups ==
|
56 |
+
|
57 |
+
Compose your configuration from those groups (For example, append hydra/job_logging=disabled
|
58 |
+
to command line)
|
59 |
+
|
60 |
+
|
61 |
+
$HYDRA_CONFIG_GROUPS
|
62 |
+
|
63 |
+
|
64 |
+
Use ''--cfg hydra'' to Show the Hydra config.
|
65 |
+
|
66 |
+
'
|
67 |
+
hydra_help: ???
|
68 |
+
hydra_logging:
|
69 |
+
version: 1
|
70 |
+
formatters:
|
71 |
+
colorlog:
|
72 |
+
(): colorlog.ColoredFormatter
|
73 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(purple)sHYDRA%(reset)s] %(message)s'
|
74 |
+
handlers:
|
75 |
+
console:
|
76 |
+
class: logging.StreamHandler
|
77 |
+
formatter: colorlog
|
78 |
+
stream: ext://sys.stdout
|
79 |
+
root:
|
80 |
+
level: INFO
|
81 |
+
handlers:
|
82 |
+
- console
|
83 |
+
disable_existing_loggers: false
|
84 |
+
job_logging:
|
85 |
+
version: 1
|
86 |
+
formatters:
|
87 |
+
simple:
|
88 |
+
format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
|
89 |
+
colorlog:
|
90 |
+
(): colorlog.ColoredFormatter
|
91 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(blue)s%(name)s%(reset)s][%(log_color)s%(levelname)s%(reset)s]
|
92 |
+
- %(message)s'
|
93 |
+
log_colors:
|
94 |
+
DEBUG: purple
|
95 |
+
INFO: green
|
96 |
+
WARNING: yellow
|
97 |
+
ERROR: red
|
98 |
+
CRITICAL: red
|
99 |
+
handlers:
|
100 |
+
console:
|
101 |
+
class: logging.StreamHandler
|
102 |
+
formatter: colorlog
|
103 |
+
stream: ext://sys.stdout
|
104 |
+
file:
|
105 |
+
class: logging.FileHandler
|
106 |
+
formatter: simple
|
107 |
+
filename: ${hydra.runtime.output_dir}/${task_name}.log
|
108 |
+
root:
|
109 |
+
level: INFO
|
110 |
+
handlers:
|
111 |
+
- console
|
112 |
+
- file
|
113 |
+
disable_existing_loggers: false
|
114 |
+
env: {}
|
115 |
+
mode: RUN
|
116 |
+
searchpath: []
|
117 |
+
callbacks: {}
|
118 |
+
output_subdir: .hydra
|
119 |
+
overrides:
|
120 |
+
hydra:
|
121 |
+
- hydra.mode=RUN
|
122 |
+
task: []
|
123 |
+
job:
|
124 |
+
name: hydra_test
|
125 |
+
chdir: null
|
126 |
+
override_dirname: ''
|
127 |
+
id: ???
|
128 |
+
num: ???
|
129 |
+
config_name: train
|
130 |
+
env_set: {}
|
131 |
+
env_copy: []
|
132 |
+
config:
|
133 |
+
override_dirname:
|
134 |
+
kv_sep: '='
|
135 |
+
item_sep: ','
|
136 |
+
exclude_keys: []
|
137 |
+
runtime:
|
138 |
+
version: 1.3.2
|
139 |
+
version_base: '1.1'
|
140 |
+
cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws
|
141 |
+
config_sources:
|
142 |
+
- path: hydra.conf
|
143 |
+
schema: pkg
|
144 |
+
provider: hydra
|
145 |
+
- path: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/configs
|
146 |
+
schema: file
|
147 |
+
provider: main
|
148 |
+
- path: hydra_plugins.hydra_colorlog.conf
|
149 |
+
schema: pkg
|
150 |
+
provider: hydra-colorlog
|
151 |
+
- path: ''
|
152 |
+
schema: structured
|
153 |
+
provider: schema
|
154 |
+
output_dir: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/logs/train/runs/2024-11-08_15-29-42
|
155 |
+
choices:
|
156 |
+
debug: null
|
157 |
+
experiment: catdog_experiment
|
158 |
+
hydra: default
|
159 |
+
paths: catdog
|
160 |
+
trainer: default
|
161 |
+
logger: default
|
162 |
+
callbacks: default
|
163 |
+
model: catdog_classifier
|
164 |
+
data: catdog
|
165 |
+
hydra/env: default
|
166 |
+
hydra/callbacks: null
|
167 |
+
hydra/job_logging: colorlog
|
168 |
+
hydra/hydra_logging: colorlog
|
169 |
+
hydra/hydra_help: default
|
170 |
+
hydra/help: default
|
171 |
+
hydra/sweeper: basic
|
172 |
+
hydra/launcher: basic
|
173 |
+
hydra/output: default
|
174 |
+
verbose: false
|
logs/train/runs/2024-11-08_15-29-42/.hydra/overrides.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[]
|
logs/train/runs/2024-11-08_15-29-42/train.log
ADDED
File without changes
|
logs/train/runs/2024-11-08_15-30-22/.hydra/config.yaml
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
task_name: train
|
2 |
+
tags:
|
3 |
+
- dev
|
4 |
+
train: true
|
5 |
+
test: false
|
6 |
+
ckpt_path: ${paths.ckpt_dir}/best-checkpoint.ckpt
|
7 |
+
seed: 42
|
8 |
+
name: catdog_experiment
|
9 |
+
data:
|
10 |
+
_target_: src.datamodules.catdog_datamodule.CatDogImageDataModule
|
11 |
+
data_dir: ${paths.data_dir}
|
12 |
+
url: ${paths.data_url}
|
13 |
+
num_workers: 8
|
14 |
+
batch_size: 64
|
15 |
+
train_val_split:
|
16 |
+
- 0.8
|
17 |
+
- 0.2
|
18 |
+
pin_memory: true
|
19 |
+
image_size: 160
|
20 |
+
dataset_url: https://download.pytorch.org/tutorials/cats_and_dogs_filtered.zip
|
21 |
+
model:
|
22 |
+
_target_: src.models.catdog_model.ViTTinyClassifier
|
23 |
+
img_size: 160
|
24 |
+
patch_size: 16
|
25 |
+
num_classes: 2
|
26 |
+
embed_dim: 64
|
27 |
+
depth: 6
|
28 |
+
num_heads: 2
|
29 |
+
mlp_ratio: 3
|
30 |
+
pre_norm: false
|
31 |
+
lr: 0.001
|
32 |
+
weight_decay: 1.0e-05
|
33 |
+
factor: 0.1
|
34 |
+
patience: 10
|
35 |
+
min_lr: 1.0e-06
|
36 |
+
callbacks:
|
37 |
+
model_checkpoint:
|
38 |
+
dirpath: ${paths.ckpt_dir}
|
39 |
+
filename: best-checkpoint
|
40 |
+
monitor: val_acc
|
41 |
+
verbose: false
|
42 |
+
save_last: true
|
43 |
+
save_top_k: 1
|
44 |
+
mode: max
|
45 |
+
auto_insert_metric_name: false
|
46 |
+
save_weights_only: false
|
47 |
+
every_n_train_steps: null
|
48 |
+
train_time_interval: null
|
49 |
+
every_n_epochs: null
|
50 |
+
save_on_train_epoch_end: null
|
51 |
+
early_stopping:
|
52 |
+
monitor: val_acc
|
53 |
+
min_delta: 0.0
|
54 |
+
patience: 10
|
55 |
+
verbose: false
|
56 |
+
mode: max
|
57 |
+
strict: true
|
58 |
+
check_finite: true
|
59 |
+
stopping_threshold: null
|
60 |
+
divergence_threshold: null
|
61 |
+
check_on_train_epoch_end: null
|
62 |
+
model_summary:
|
63 |
+
max_depth: 1
|
64 |
+
rich_progress_bar:
|
65 |
+
refresh_rate: 1
|
66 |
+
logger:
|
67 |
+
csv:
|
68 |
+
save_dir: ${paths.output_dir}
|
69 |
+
name: csv/
|
70 |
+
prefix: ''
|
71 |
+
tensorboard:
|
72 |
+
save_dir: ${paths.output_dir}/tensorboard/
|
73 |
+
name: null
|
74 |
+
log_graph: false
|
75 |
+
default_hp_metric: true
|
76 |
+
prefix: ''
|
77 |
+
trainer:
|
78 |
+
_target_: lightning.Trainer
|
79 |
+
default_root_dir: ${paths.output_dir}
|
80 |
+
min_epochs: 1
|
81 |
+
max_epochs: 6
|
82 |
+
accelerator: auto
|
83 |
+
devices: auto
|
84 |
+
deterministic: true
|
85 |
+
log_every_n_steps: 10
|
86 |
+
fast_dev_run: false
|
87 |
+
paths:
|
88 |
+
root_dir: ${oc.env:PROJECT_ROOT}
|
89 |
+
data_dir: ${paths.root_dir}/data/
|
90 |
+
log_dir: ${paths.root_dir}/logs/
|
91 |
+
ckpt_dir: ${paths.root_dir}/checkpoints
|
92 |
+
artifact_dir: ${paths.root_dir}/artifacts/
|
93 |
+
data_url: https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip
|
94 |
+
output_dir: ${hydra:runtime.output_dir}
|
95 |
+
work_dir: ${hydra:runtime.cwd}
|
logs/train/runs/2024-11-08_15-30-22/.hydra/hydra.yaml
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
hydra:
|
2 |
+
run:
|
3 |
+
dir: ${paths.log_dir}/${task_name}/runs/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
4 |
+
sweep:
|
5 |
+
dir: ${paths.log_dir}/${task_name}/multiruns/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
6 |
+
subdir: ${hydra.job.num}
|
7 |
+
launcher:
|
8 |
+
_target_: hydra._internal.core_plugins.basic_launcher.BasicLauncher
|
9 |
+
sweeper:
|
10 |
+
_target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
|
11 |
+
max_batch_size: null
|
12 |
+
params: null
|
13 |
+
help:
|
14 |
+
app_name: ${hydra.job.name}
|
15 |
+
header: '${hydra.help.app_name} is powered by Hydra.
|
16 |
+
|
17 |
+
'
|
18 |
+
footer: 'Powered by Hydra (https://hydra.cc)
|
19 |
+
|
20 |
+
Use --hydra-help to view Hydra specific help
|
21 |
+
|
22 |
+
'
|
23 |
+
template: '${hydra.help.header}
|
24 |
+
|
25 |
+
== Configuration groups ==
|
26 |
+
|
27 |
+
Compose your configuration from those groups (group=option)
|
28 |
+
|
29 |
+
|
30 |
+
$APP_CONFIG_GROUPS
|
31 |
+
|
32 |
+
|
33 |
+
== Config ==
|
34 |
+
|
35 |
+
Override anything in the config (foo.bar=value)
|
36 |
+
|
37 |
+
|
38 |
+
$CONFIG
|
39 |
+
|
40 |
+
|
41 |
+
${hydra.help.footer}
|
42 |
+
|
43 |
+
'
|
44 |
+
hydra_help:
|
45 |
+
template: 'Hydra (${hydra.runtime.version})
|
46 |
+
|
47 |
+
See https://hydra.cc for more info.
|
48 |
+
|
49 |
+
|
50 |
+
== Flags ==
|
51 |
+
|
52 |
+
$FLAGS_HELP
|
53 |
+
|
54 |
+
|
55 |
+
== Configuration groups ==
|
56 |
+
|
57 |
+
Compose your configuration from those groups (For example, append hydra/job_logging=disabled
|
58 |
+
to command line)
|
59 |
+
|
60 |
+
|
61 |
+
$HYDRA_CONFIG_GROUPS
|
62 |
+
|
63 |
+
|
64 |
+
Use ''--cfg hydra'' to Show the Hydra config.
|
65 |
+
|
66 |
+
'
|
67 |
+
hydra_help: ???
|
68 |
+
hydra_logging:
|
69 |
+
version: 1
|
70 |
+
formatters:
|
71 |
+
colorlog:
|
72 |
+
(): colorlog.ColoredFormatter
|
73 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(purple)sHYDRA%(reset)s] %(message)s'
|
74 |
+
handlers:
|
75 |
+
console:
|
76 |
+
class: logging.StreamHandler
|
77 |
+
formatter: colorlog
|
78 |
+
stream: ext://sys.stdout
|
79 |
+
root:
|
80 |
+
level: INFO
|
81 |
+
handlers:
|
82 |
+
- console
|
83 |
+
disable_existing_loggers: false
|
84 |
+
job_logging:
|
85 |
+
version: 1
|
86 |
+
formatters:
|
87 |
+
simple:
|
88 |
+
format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
|
89 |
+
colorlog:
|
90 |
+
(): colorlog.ColoredFormatter
|
91 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(blue)s%(name)s%(reset)s][%(log_color)s%(levelname)s%(reset)s]
|
92 |
+
- %(message)s'
|
93 |
+
log_colors:
|
94 |
+
DEBUG: purple
|
95 |
+
INFO: green
|
96 |
+
WARNING: yellow
|
97 |
+
ERROR: red
|
98 |
+
CRITICAL: red
|
99 |
+
handlers:
|
100 |
+
console:
|
101 |
+
class: logging.StreamHandler
|
102 |
+
formatter: colorlog
|
103 |
+
stream: ext://sys.stdout
|
104 |
+
file:
|
105 |
+
class: logging.FileHandler
|
106 |
+
formatter: simple
|
107 |
+
filename: ${hydra.runtime.output_dir}/${task_name}.log
|
108 |
+
root:
|
109 |
+
level: INFO
|
110 |
+
handlers:
|
111 |
+
- console
|
112 |
+
- file
|
113 |
+
disable_existing_loggers: false
|
114 |
+
env: {}
|
115 |
+
mode: RUN
|
116 |
+
searchpath: []
|
117 |
+
callbacks: {}
|
118 |
+
output_subdir: .hydra
|
119 |
+
overrides:
|
120 |
+
hydra:
|
121 |
+
- hydra.mode=RUN
|
122 |
+
task: []
|
123 |
+
job:
|
124 |
+
name: hydra_test
|
125 |
+
chdir: null
|
126 |
+
override_dirname: ''
|
127 |
+
id: ???
|
128 |
+
num: ???
|
129 |
+
config_name: train
|
130 |
+
env_set: {}
|
131 |
+
env_copy: []
|
132 |
+
config:
|
133 |
+
override_dirname:
|
134 |
+
kv_sep: '='
|
135 |
+
item_sep: ','
|
136 |
+
exclude_keys: []
|
137 |
+
runtime:
|
138 |
+
version: 1.3.2
|
139 |
+
version_base: '1.1'
|
140 |
+
cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws
|
141 |
+
config_sources:
|
142 |
+
- path: hydra.conf
|
143 |
+
schema: pkg
|
144 |
+
provider: hydra
|
145 |
+
- path: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/configs
|
146 |
+
schema: file
|
147 |
+
provider: main
|
148 |
+
- path: hydra_plugins.hydra_colorlog.conf
|
149 |
+
schema: pkg
|
150 |
+
provider: hydra-colorlog
|
151 |
+
- path: ''
|
152 |
+
schema: structured
|
153 |
+
provider: schema
|
154 |
+
output_dir: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/logs/train/runs/2024-11-08_15-30-22
|
155 |
+
choices:
|
156 |
+
debug: null
|
157 |
+
experiment: catdog_experiment
|
158 |
+
hydra: default
|
159 |
+
paths: catdog
|
160 |
+
trainer: default
|
161 |
+
logger: default
|
162 |
+
callbacks: default
|
163 |
+
model: catdog_classifier
|
164 |
+
data: catdog
|
165 |
+
hydra/env: default
|
166 |
+
hydra/callbacks: null
|
167 |
+
hydra/job_logging: colorlog
|
168 |
+
hydra/hydra_logging: colorlog
|
169 |
+
hydra/hydra_help: default
|
170 |
+
hydra/help: default
|
171 |
+
hydra/sweeper: basic
|
172 |
+
hydra/launcher: basic
|
173 |
+
hydra/output: default
|
174 |
+
verbose: false
|
logs/train/runs/2024-11-08_15-30-22/.hydra/overrides.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[]
|
logs/train/runs/2024-11-08_15-30-22/train.log
ADDED
File without changes
|
logs/train/runs/2024-11-08_15-35-40/.hydra/config.yaml
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
task_name: train
|
2 |
+
tags:
|
3 |
+
- dev
|
4 |
+
train: true
|
5 |
+
test: false
|
6 |
+
ckpt_path: ${paths.ckpt_dir}/best-checkpoint.ckpt
|
7 |
+
seed: 42
|
8 |
+
name: catdog_experiment
|
9 |
+
data:
|
10 |
+
_target_: src.datamodules.catdog_datamodule.CatDogImageDataModule
|
11 |
+
data_dir: ${paths.data_dir}
|
12 |
+
url: ${paths.data_url}
|
13 |
+
num_workers: 8
|
14 |
+
batch_size: 64
|
15 |
+
train_val_split:
|
16 |
+
- 0.8
|
17 |
+
- 0.2
|
18 |
+
pin_memory: true
|
19 |
+
image_size: 160
|
20 |
+
dataset_url: https://download.pytorch.org/tutorials/cats_and_dogs_filtered.zip
|
21 |
+
model:
|
22 |
+
_target_: src.models.catdog_model.ViTTinyClassifier
|
23 |
+
img_size: 160
|
24 |
+
patch_size: 16
|
25 |
+
num_classes: 2
|
26 |
+
embed_dim: 64
|
27 |
+
depth: 6
|
28 |
+
num_heads: 2
|
29 |
+
mlp_ratio: 3
|
30 |
+
pre_norm: false
|
31 |
+
lr: 0.001
|
32 |
+
weight_decay: 1.0e-05
|
33 |
+
factor: 0.1
|
34 |
+
patience: 10
|
35 |
+
min_lr: 1.0e-06
|
36 |
+
callbacks:
|
37 |
+
model_checkpoint:
|
38 |
+
dirpath: ${paths.ckpt_dir}
|
39 |
+
filename: best-checkpoint
|
40 |
+
monitor: val_acc
|
41 |
+
verbose: false
|
42 |
+
save_last: true
|
43 |
+
save_top_k: 1
|
44 |
+
mode: max
|
45 |
+
auto_insert_metric_name: false
|
46 |
+
save_weights_only: false
|
47 |
+
every_n_train_steps: null
|
48 |
+
train_time_interval: null
|
49 |
+
every_n_epochs: null
|
50 |
+
save_on_train_epoch_end: null
|
51 |
+
early_stopping:
|
52 |
+
monitor: val_acc
|
53 |
+
min_delta: 0.0
|
54 |
+
patience: 10
|
55 |
+
verbose: false
|
56 |
+
mode: max
|
57 |
+
strict: true
|
58 |
+
check_finite: true
|
59 |
+
stopping_threshold: null
|
60 |
+
divergence_threshold: null
|
61 |
+
check_on_train_epoch_end: null
|
62 |
+
model_summary:
|
63 |
+
max_depth: 1
|
64 |
+
rich_progress_bar:
|
65 |
+
refresh_rate: 1
|
66 |
+
logger:
|
67 |
+
csv:
|
68 |
+
save_dir: ${paths.output_dir}
|
69 |
+
name: csv/
|
70 |
+
prefix: ''
|
71 |
+
tensorboard:
|
72 |
+
save_dir: ${paths.output_dir}/tensorboard/
|
73 |
+
name: null
|
74 |
+
log_graph: false
|
75 |
+
default_hp_metric: true
|
76 |
+
prefix: ''
|
77 |
+
trainer:
|
78 |
+
_target_: lightning.Trainer
|
79 |
+
default_root_dir: ${paths.output_dir}
|
80 |
+
min_epochs: 1
|
81 |
+
max_epochs: 6
|
82 |
+
accelerator: auto
|
83 |
+
devices: auto
|
84 |
+
deterministic: true
|
85 |
+
log_every_n_steps: 10
|
86 |
+
fast_dev_run: false
|
87 |
+
paths:
|
88 |
+
root_dir: ${oc.env:PROJECT_ROOT}
|
89 |
+
data_dir: ${paths.root_dir}/data/
|
90 |
+
log_dir: ${paths.root_dir}/logs/
|
91 |
+
ckpt_dir: ${paths.root_dir}/checkpoints
|
92 |
+
artifact_dir: ${paths.root_dir}/artifacts/
|
93 |
+
data_url: https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip
|
94 |
+
output_dir: ${hydra:runtime.output_dir}
|
95 |
+
work_dir: ${hydra:runtime.cwd}
|
logs/train/runs/2024-11-08_15-35-40/.hydra/hydra.yaml
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
hydra:
|
2 |
+
run:
|
3 |
+
dir: ${paths.log_dir}/${task_name}/runs/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
4 |
+
sweep:
|
5 |
+
dir: ${paths.log_dir}/${task_name}/multiruns/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
6 |
+
subdir: ${hydra.job.num}
|
7 |
+
launcher:
|
8 |
+
_target_: hydra._internal.core_plugins.basic_launcher.BasicLauncher
|
9 |
+
sweeper:
|
10 |
+
_target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
|
11 |
+
max_batch_size: null
|
12 |
+
params: null
|
13 |
+
help:
|
14 |
+
app_name: ${hydra.job.name}
|
15 |
+
header: '${hydra.help.app_name} is powered by Hydra.
|
16 |
+
|
17 |
+
'
|
18 |
+
footer: 'Powered by Hydra (https://hydra.cc)
|
19 |
+
|
20 |
+
Use --hydra-help to view Hydra specific help
|
21 |
+
|
22 |
+
'
|
23 |
+
template: '${hydra.help.header}
|
24 |
+
|
25 |
+
== Configuration groups ==
|
26 |
+
|
27 |
+
Compose your configuration from those groups (group=option)
|
28 |
+
|
29 |
+
|
30 |
+
$APP_CONFIG_GROUPS
|
31 |
+
|
32 |
+
|
33 |
+
== Config ==
|
34 |
+
|
35 |
+
Override anything in the config (foo.bar=value)
|
36 |
+
|
37 |
+
|
38 |
+
$CONFIG
|
39 |
+
|
40 |
+
|
41 |
+
${hydra.help.footer}
|
42 |
+
|
43 |
+
'
|
44 |
+
hydra_help:
|
45 |
+
template: 'Hydra (${hydra.runtime.version})
|
46 |
+
|
47 |
+
See https://hydra.cc for more info.
|
48 |
+
|
49 |
+
|
50 |
+
== Flags ==
|
51 |
+
|
52 |
+
$FLAGS_HELP
|
53 |
+
|
54 |
+
|
55 |
+
== Configuration groups ==
|
56 |
+
|
57 |
+
Compose your configuration from those groups (For example, append hydra/job_logging=disabled
|
58 |
+
to command line)
|
59 |
+
|
60 |
+
|
61 |
+
$HYDRA_CONFIG_GROUPS
|
62 |
+
|
63 |
+
|
64 |
+
Use ''--cfg hydra'' to Show the Hydra config.
|
65 |
+
|
66 |
+
'
|
67 |
+
hydra_help: ???
|
68 |
+
hydra_logging:
|
69 |
+
version: 1
|
70 |
+
formatters:
|
71 |
+
colorlog:
|
72 |
+
(): colorlog.ColoredFormatter
|
73 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(purple)sHYDRA%(reset)s] %(message)s'
|
74 |
+
handlers:
|
75 |
+
console:
|
76 |
+
class: logging.StreamHandler
|
77 |
+
formatter: colorlog
|
78 |
+
stream: ext://sys.stdout
|
79 |
+
root:
|
80 |
+
level: INFO
|
81 |
+
handlers:
|
82 |
+
- console
|
83 |
+
disable_existing_loggers: false
|
84 |
+
job_logging:
|
85 |
+
version: 1
|
86 |
+
formatters:
|
87 |
+
simple:
|
88 |
+
format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
|
89 |
+
colorlog:
|
90 |
+
(): colorlog.ColoredFormatter
|
91 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(blue)s%(name)s%(reset)s][%(log_color)s%(levelname)s%(reset)s]
|
92 |
+
- %(message)s'
|
93 |
+
log_colors:
|
94 |
+
DEBUG: purple
|
95 |
+
INFO: green
|
96 |
+
WARNING: yellow
|
97 |
+
ERROR: red
|
98 |
+
CRITICAL: red
|
99 |
+
handlers:
|
100 |
+
console:
|
101 |
+
class: logging.StreamHandler
|
102 |
+
formatter: colorlog
|
103 |
+
stream: ext://sys.stdout
|
104 |
+
file:
|
105 |
+
class: logging.FileHandler
|
106 |
+
formatter: simple
|
107 |
+
filename: ${hydra.runtime.output_dir}/${task_name}.log
|
108 |
+
root:
|
109 |
+
level: INFO
|
110 |
+
handlers:
|
111 |
+
- console
|
112 |
+
- file
|
113 |
+
disable_existing_loggers: false
|
114 |
+
env: {}
|
115 |
+
mode: RUN
|
116 |
+
searchpath: []
|
117 |
+
callbacks: {}
|
118 |
+
output_subdir: .hydra
|
119 |
+
overrides:
|
120 |
+
hydra:
|
121 |
+
- hydra.mode=RUN
|
122 |
+
task: []
|
123 |
+
job:
|
124 |
+
name: hydra_test2
|
125 |
+
chdir: null
|
126 |
+
override_dirname: ''
|
127 |
+
id: ???
|
128 |
+
num: ???
|
129 |
+
config_name: train
|
130 |
+
env_set: {}
|
131 |
+
env_copy: []
|
132 |
+
config:
|
133 |
+
override_dirname:
|
134 |
+
kv_sep: '='
|
135 |
+
item_sep: ','
|
136 |
+
exclude_keys: []
|
137 |
+
runtime:
|
138 |
+
version: 1.3.2
|
139 |
+
version_base: '1.1'
|
140 |
+
cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws
|
141 |
+
config_sources:
|
142 |
+
- path: hydra.conf
|
143 |
+
schema: pkg
|
144 |
+
provider: hydra
|
145 |
+
- path: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/configs
|
146 |
+
schema: file
|
147 |
+
provider: main
|
148 |
+
- path: hydra_plugins.hydra_colorlog.conf
|
149 |
+
schema: pkg
|
150 |
+
provider: hydra-colorlog
|
151 |
+
- path: ''
|
152 |
+
schema: structured
|
153 |
+
provider: schema
|
154 |
+
output_dir: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/logs/train/runs/2024-11-08_15-35-40
|
155 |
+
choices:
|
156 |
+
debug: null
|
157 |
+
experiment: catdog_experiment
|
158 |
+
hydra: default
|
159 |
+
paths: catdog
|
160 |
+
trainer: default
|
161 |
+
logger: default
|
162 |
+
callbacks: default
|
163 |
+
model: catdog_classifier
|
164 |
+
data: catdog
|
165 |
+
hydra/env: default
|
166 |
+
hydra/callbacks: null
|
167 |
+
hydra/job_logging: colorlog
|
168 |
+
hydra/hydra_logging: colorlog
|
169 |
+
hydra/hydra_help: default
|
170 |
+
hydra/help: default
|
171 |
+
hydra/sweeper: basic
|
172 |
+
hydra/launcher: basic
|
173 |
+
hydra/output: default
|
174 |
+
verbose: false
|
logs/train/runs/2024-11-08_15-35-40/.hydra/overrides.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[]
|
logs/train/runs/2024-11-08_15-35-40/train.log
ADDED
File without changes
|
logs/train/runs/2024-11-08_15-35-57/.hydra/config.yaml
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
task_name: train
|
2 |
+
tags:
|
3 |
+
- dev
|
4 |
+
train: true
|
5 |
+
test: false
|
6 |
+
ckpt_path: ${paths.ckpt_dir}/best-checkpoint.ckpt
|
7 |
+
seed: 42
|
8 |
+
name: catdog_experiment
|
9 |
+
data:
|
10 |
+
_target_: src.datamodules.catdog_datamodule.CatDogImageDataModule
|
11 |
+
data_dir: ${paths.data_dir}
|
12 |
+
url: ${paths.data_url}
|
13 |
+
num_workers: 8
|
14 |
+
batch_size: 64
|
15 |
+
train_val_split:
|
16 |
+
- 0.8
|
17 |
+
- 0.2
|
18 |
+
pin_memory: true
|
19 |
+
image_size: 160
|
20 |
+
dataset_url: https://download.pytorch.org/tutorials/cats_and_dogs_filtered.zip
|
21 |
+
model:
|
22 |
+
_target_: src.models.catdog_model.ViTTinyClassifier
|
23 |
+
img_size: 160
|
24 |
+
patch_size: 16
|
25 |
+
num_classes: 2
|
26 |
+
embed_dim: 64
|
27 |
+
depth: 6
|
28 |
+
num_heads: 2
|
29 |
+
mlp_ratio: 3
|
30 |
+
pre_norm: false
|
31 |
+
lr: 0.001
|
32 |
+
weight_decay: 1.0e-05
|
33 |
+
factor: 0.1
|
34 |
+
patience: 10
|
35 |
+
min_lr: 1.0e-06
|
36 |
+
callbacks:
|
37 |
+
model_checkpoint:
|
38 |
+
dirpath: ${paths.ckpt_dir}
|
39 |
+
filename: best-checkpoint
|
40 |
+
monitor: val_acc
|
41 |
+
verbose: false
|
42 |
+
save_last: true
|
43 |
+
save_top_k: 1
|
44 |
+
mode: max
|
45 |
+
auto_insert_metric_name: false
|
46 |
+
save_weights_only: false
|
47 |
+
every_n_train_steps: null
|
48 |
+
train_time_interval: null
|
49 |
+
every_n_epochs: null
|
50 |
+
save_on_train_epoch_end: null
|
51 |
+
early_stopping:
|
52 |
+
monitor: val_acc
|
53 |
+
min_delta: 0.0
|
54 |
+
patience: 10
|
55 |
+
verbose: false
|
56 |
+
mode: max
|
57 |
+
strict: true
|
58 |
+
check_finite: true
|
59 |
+
stopping_threshold: null
|
60 |
+
divergence_threshold: null
|
61 |
+
check_on_train_epoch_end: null
|
62 |
+
model_summary:
|
63 |
+
max_depth: 1
|
64 |
+
rich_progress_bar:
|
65 |
+
refresh_rate: 1
|
66 |
+
logger:
|
67 |
+
csv:
|
68 |
+
save_dir: ${paths.output_dir}
|
69 |
+
name: csv/
|
70 |
+
prefix: ''
|
71 |
+
tensorboard:
|
72 |
+
save_dir: ${paths.output_dir}/tensorboard/
|
73 |
+
name: null
|
74 |
+
log_graph: false
|
75 |
+
default_hp_metric: true
|
76 |
+
prefix: ''
|
77 |
+
trainer:
|
78 |
+
_target_: lightning.Trainer
|
79 |
+
default_root_dir: ${paths.output_dir}
|
80 |
+
min_epochs: 1
|
81 |
+
max_epochs: 6
|
82 |
+
accelerator: auto
|
83 |
+
devices: auto
|
84 |
+
deterministic: true
|
85 |
+
log_every_n_steps: 10
|
86 |
+
fast_dev_run: false
|
87 |
+
paths:
|
88 |
+
root_dir: ${oc.env:PROJECT_ROOT}
|
89 |
+
data_dir: ${paths.root_dir}/data/
|
90 |
+
log_dir: ${paths.root_dir}/logs/
|
91 |
+
ckpt_dir: ${paths.root_dir}/checkpoints
|
92 |
+
artifact_dir: ${paths.root_dir}/artifacts/
|
93 |
+
data_url: https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip
|
94 |
+
output_dir: ${hydra:runtime.output_dir}
|
95 |
+
work_dir: ${hydra:runtime.cwd}
|
logs/train/runs/2024-11-08_15-35-57/.hydra/hydra.yaml
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
hydra:
|
2 |
+
run:
|
3 |
+
dir: ${paths.log_dir}/${task_name}/runs/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
4 |
+
sweep:
|
5 |
+
dir: ${paths.log_dir}/${task_name}/multiruns/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
6 |
+
subdir: ${hydra.job.num}
|
7 |
+
launcher:
|
8 |
+
_target_: hydra._internal.core_plugins.basic_launcher.BasicLauncher
|
9 |
+
sweeper:
|
10 |
+
_target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
|
11 |
+
max_batch_size: null
|
12 |
+
params: null
|
13 |
+
help:
|
14 |
+
app_name: ${hydra.job.name}
|
15 |
+
header: '${hydra.help.app_name} is powered by Hydra.
|
16 |
+
|
17 |
+
'
|
18 |
+
footer: 'Powered by Hydra (https://hydra.cc)
|
19 |
+
|
20 |
+
Use --hydra-help to view Hydra specific help
|
21 |
+
|
22 |
+
'
|
23 |
+
template: '${hydra.help.header}
|
24 |
+
|
25 |
+
== Configuration groups ==
|
26 |
+
|
27 |
+
Compose your configuration from those groups (group=option)
|
28 |
+
|
29 |
+
|
30 |
+
$APP_CONFIG_GROUPS
|
31 |
+
|
32 |
+
|
33 |
+
== Config ==
|
34 |
+
|
35 |
+
Override anything in the config (foo.bar=value)
|
36 |
+
|
37 |
+
|
38 |
+
$CONFIG
|
39 |
+
|
40 |
+
|
41 |
+
${hydra.help.footer}
|
42 |
+
|
43 |
+
'
|
44 |
+
hydra_help:
|
45 |
+
template: 'Hydra (${hydra.runtime.version})
|
46 |
+
|
47 |
+
See https://hydra.cc for more info.
|
48 |
+
|
49 |
+
|
50 |
+
== Flags ==
|
51 |
+
|
52 |
+
$FLAGS_HELP
|
53 |
+
|
54 |
+
|
55 |
+
== Configuration groups ==
|
56 |
+
|
57 |
+
Compose your configuration from those groups (For example, append hydra/job_logging=disabled
|
58 |
+
to command line)
|
59 |
+
|
60 |
+
|
61 |
+
$HYDRA_CONFIG_GROUPS
|
62 |
+
|
63 |
+
|
64 |
+
Use ''--cfg hydra'' to Show the Hydra config.
|
65 |
+
|
66 |
+
'
|
67 |
+
hydra_help: ???
|
68 |
+
hydra_logging:
|
69 |
+
version: 1
|
70 |
+
formatters:
|
71 |
+
colorlog:
|
72 |
+
(): colorlog.ColoredFormatter
|
73 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(purple)sHYDRA%(reset)s] %(message)s'
|
74 |
+
handlers:
|
75 |
+
console:
|
76 |
+
class: logging.StreamHandler
|
77 |
+
formatter: colorlog
|
78 |
+
stream: ext://sys.stdout
|
79 |
+
root:
|
80 |
+
level: INFO
|
81 |
+
handlers:
|
82 |
+
- console
|
83 |
+
disable_existing_loggers: false
|
84 |
+
job_logging:
|
85 |
+
version: 1
|
86 |
+
formatters:
|
87 |
+
simple:
|
88 |
+
format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
|
89 |
+
colorlog:
|
90 |
+
(): colorlog.ColoredFormatter
|
91 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(blue)s%(name)s%(reset)s][%(log_color)s%(levelname)s%(reset)s]
|
92 |
+
- %(message)s'
|
93 |
+
log_colors:
|
94 |
+
DEBUG: purple
|
95 |
+
INFO: green
|
96 |
+
WARNING: yellow
|
97 |
+
ERROR: red
|
98 |
+
CRITICAL: red
|
99 |
+
handlers:
|
100 |
+
console:
|
101 |
+
class: logging.StreamHandler
|
102 |
+
formatter: colorlog
|
103 |
+
stream: ext://sys.stdout
|
104 |
+
file:
|
105 |
+
class: logging.FileHandler
|
106 |
+
formatter: simple
|
107 |
+
filename: ${hydra.runtime.output_dir}/${task_name}.log
|
108 |
+
root:
|
109 |
+
level: INFO
|
110 |
+
handlers:
|
111 |
+
- console
|
112 |
+
- file
|
113 |
+
disable_existing_loggers: false
|
114 |
+
env: {}
|
115 |
+
mode: RUN
|
116 |
+
searchpath: []
|
117 |
+
callbacks: {}
|
118 |
+
output_subdir: .hydra
|
119 |
+
overrides:
|
120 |
+
hydra:
|
121 |
+
- hydra.mode=RUN
|
122 |
+
task: []
|
123 |
+
job:
|
124 |
+
name: hydra_test2
|
125 |
+
chdir: null
|
126 |
+
override_dirname: ''
|
127 |
+
id: ???
|
128 |
+
num: ???
|
129 |
+
config_name: train
|
130 |
+
env_set: {}
|
131 |
+
env_copy: []
|
132 |
+
config:
|
133 |
+
override_dirname:
|
134 |
+
kv_sep: '='
|
135 |
+
item_sep: ','
|
136 |
+
exclude_keys: []
|
137 |
+
runtime:
|
138 |
+
version: 1.3.2
|
139 |
+
version_base: '1.1'
|
140 |
+
cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws
|
141 |
+
config_sources:
|
142 |
+
- path: hydra.conf
|
143 |
+
schema: pkg
|
144 |
+
provider: hydra
|
145 |
+
- path: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/configs
|
146 |
+
schema: file
|
147 |
+
provider: main
|
148 |
+
- path: hydra_plugins.hydra_colorlog.conf
|
149 |
+
schema: pkg
|
150 |
+
provider: hydra-colorlog
|
151 |
+
- path: ''
|
152 |
+
schema: structured
|
153 |
+
provider: schema
|
154 |
+
output_dir: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/logs/train/runs/2024-11-08_15-35-57
|
155 |
+
choices:
|
156 |
+
debug: null
|
157 |
+
experiment: catdog_experiment
|
158 |
+
hydra: default
|
159 |
+
paths: catdog
|
160 |
+
trainer: default
|
161 |
+
logger: default
|
162 |
+
callbacks: default
|
163 |
+
model: catdog_classifier
|
164 |
+
data: catdog
|
165 |
+
hydra/env: default
|
166 |
+
hydra/callbacks: null
|
167 |
+
hydra/job_logging: colorlog
|
168 |
+
hydra/hydra_logging: colorlog
|
169 |
+
hydra/hydra_help: default
|
170 |
+
hydra/help: default
|
171 |
+
hydra/sweeper: basic
|
172 |
+
hydra/launcher: basic
|
173 |
+
hydra/output: default
|
174 |
+
verbose: false
|
logs/train/runs/2024-11-08_15-35-57/.hydra/overrides.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[]
|
logs/train/runs/2024-11-08_15-35-57/train.log
ADDED
File without changes
|
logs/train/runs/2024-11-08_15-37-45/.hydra/config.yaml
ADDED
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
task_name: train
|
2 |
+
tags:
|
3 |
+
- dev
|
4 |
+
train: true
|
5 |
+
test: false
|
6 |
+
ckpt_path: ${paths.ckpt_dir}/best-checkpoint.ckpt
|
7 |
+
seed: 42
|
8 |
+
name: catdog_experiment
|
9 |
+
data:
|
10 |
+
_target_: src.datamodules.catdog_datamodule.CatDogImageDataModule
|
11 |
+
data_dir: ${paths.data_dir}
|
12 |
+
url: ${paths.data_url}
|
13 |
+
num_workers: 8
|
14 |
+
batch_size: 64
|
15 |
+
train_val_split:
|
16 |
+
- 0.8
|
17 |
+
- 0.2
|
18 |
+
pin_memory: true
|
19 |
+
image_size: 160
|
20 |
+
dataset_url: https://download.pytorch.org/tutorials/cats_and_dogs_filtered.zip
|
21 |
+
model:
|
22 |
+
_target_: src.models.catdog_model.ViTTinyClassifier
|
23 |
+
img_size: 160
|
24 |
+
patch_size: 16
|
25 |
+
num_classes: 2
|
26 |
+
embed_dim: 64
|
27 |
+
depth: 6
|
28 |
+
num_heads: 2
|
29 |
+
mlp_ratio: 3
|
30 |
+
pre_norm: false
|
31 |
+
lr: 0.001
|
32 |
+
weight_decay: 1.0e-05
|
33 |
+
factor: 0.1
|
34 |
+
patience: 10
|
35 |
+
min_lr: 1.0e-06
|
36 |
+
callbacks:
|
37 |
+
model_checkpoint:
|
38 |
+
dirpath: ${paths.ckpt_dir}
|
39 |
+
filename: best-checkpoint
|
40 |
+
monitor: val_acc
|
41 |
+
verbose: true
|
42 |
+
save_last: true
|
43 |
+
save_top_k: 1
|
44 |
+
mode: max
|
45 |
+
auto_insert_metric_name: false
|
46 |
+
save_weights_only: false
|
47 |
+
every_n_train_steps: null
|
48 |
+
train_time_interval: null
|
49 |
+
every_n_epochs: null
|
50 |
+
save_on_train_epoch_end: null
|
51 |
+
early_stopping:
|
52 |
+
monitor: val_acc
|
53 |
+
min_delta: 0.0
|
54 |
+
patience: 10
|
55 |
+
verbose: true
|
56 |
+
mode: max
|
57 |
+
strict: true
|
58 |
+
check_finite: true
|
59 |
+
stopping_threshold: null
|
60 |
+
divergence_threshold: null
|
61 |
+
check_on_train_epoch_end: null
|
62 |
+
model_summary:
|
63 |
+
max_depth: 1
|
64 |
+
rich_progress_bar:
|
65 |
+
refresh_rate: 1
|
66 |
+
logger:
|
67 |
+
csv:
|
68 |
+
save_dir: ${paths.output_dir}
|
69 |
+
name: csv/
|
70 |
+
prefix: ''
|
71 |
+
tensorboard:
|
72 |
+
save_dir: ${paths.output_dir}/tensorboard/
|
73 |
+
name: null
|
74 |
+
log_graph: false
|
75 |
+
default_hp_metric: true
|
76 |
+
prefix: ''
|
77 |
+
trainer:
|
78 |
+
_target_: lightning.Trainer
|
79 |
+
default_root_dir: ${paths.output_dir}
|
80 |
+
min_epochs: 1
|
81 |
+
max_epochs: 6
|
82 |
+
accelerator: auto
|
83 |
+
devices: auto
|
84 |
+
deterministic: true
|
85 |
+
log_every_n_steps: 10
|
86 |
+
fast_dev_run: false
|
87 |
+
paths:
|
88 |
+
root_dir: ${oc.env:PROJECT_ROOT}
|
89 |
+
data_dir: ${paths.root_dir}/data/
|
90 |
+
log_dir: ${paths.root_dir}/logs/
|
91 |
+
ckpt_dir: ${paths.root_dir}/checkpoints
|
92 |
+
artifact_dir: ${paths.root_dir}/artifacts/
|
93 |
+
data_url: https://storage.googleapis.com/mledu-datasets/cats_and_dogs_filtered.zip
|
94 |
+
output_dir: ${hydra:runtime.output_dir}
|
95 |
+
work_dir: ${hydra:runtime.cwd}
|
logs/train/runs/2024-11-08_15-37-45/.hydra/hydra.yaml
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
hydra:
|
2 |
+
run:
|
3 |
+
dir: ${paths.log_dir}/${task_name}/runs/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
4 |
+
sweep:
|
5 |
+
dir: ${paths.log_dir}/${task_name}/multiruns/${now:%Y-%m-%d}_${now:%H-%M-%S}
|
6 |
+
subdir: ${hydra.job.num}
|
7 |
+
launcher:
|
8 |
+
_target_: hydra._internal.core_plugins.basic_launcher.BasicLauncher
|
9 |
+
sweeper:
|
10 |
+
_target_: hydra._internal.core_plugins.basic_sweeper.BasicSweeper
|
11 |
+
max_batch_size: null
|
12 |
+
params: null
|
13 |
+
help:
|
14 |
+
app_name: ${hydra.job.name}
|
15 |
+
header: '${hydra.help.app_name} is powered by Hydra.
|
16 |
+
|
17 |
+
'
|
18 |
+
footer: 'Powered by Hydra (https://hydra.cc)
|
19 |
+
|
20 |
+
Use --hydra-help to view Hydra specific help
|
21 |
+
|
22 |
+
'
|
23 |
+
template: '${hydra.help.header}
|
24 |
+
|
25 |
+
== Configuration groups ==
|
26 |
+
|
27 |
+
Compose your configuration from those groups (group=option)
|
28 |
+
|
29 |
+
|
30 |
+
$APP_CONFIG_GROUPS
|
31 |
+
|
32 |
+
|
33 |
+
== Config ==
|
34 |
+
|
35 |
+
Override anything in the config (foo.bar=value)
|
36 |
+
|
37 |
+
|
38 |
+
$CONFIG
|
39 |
+
|
40 |
+
|
41 |
+
${hydra.help.footer}
|
42 |
+
|
43 |
+
'
|
44 |
+
hydra_help:
|
45 |
+
template: 'Hydra (${hydra.runtime.version})
|
46 |
+
|
47 |
+
See https://hydra.cc for more info.
|
48 |
+
|
49 |
+
|
50 |
+
== Flags ==
|
51 |
+
|
52 |
+
$FLAGS_HELP
|
53 |
+
|
54 |
+
|
55 |
+
== Configuration groups ==
|
56 |
+
|
57 |
+
Compose your configuration from those groups (For example, append hydra/job_logging=disabled
|
58 |
+
to command line)
|
59 |
+
|
60 |
+
|
61 |
+
$HYDRA_CONFIG_GROUPS
|
62 |
+
|
63 |
+
|
64 |
+
Use ''--cfg hydra'' to Show the Hydra config.
|
65 |
+
|
66 |
+
'
|
67 |
+
hydra_help: ???
|
68 |
+
hydra_logging:
|
69 |
+
version: 1
|
70 |
+
formatters:
|
71 |
+
colorlog:
|
72 |
+
(): colorlog.ColoredFormatter
|
73 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(purple)sHYDRA%(reset)s] %(message)s'
|
74 |
+
handlers:
|
75 |
+
console:
|
76 |
+
class: logging.StreamHandler
|
77 |
+
formatter: colorlog
|
78 |
+
stream: ext://sys.stdout
|
79 |
+
root:
|
80 |
+
level: INFO
|
81 |
+
handlers:
|
82 |
+
- console
|
83 |
+
disable_existing_loggers: false
|
84 |
+
job_logging:
|
85 |
+
version: 1
|
86 |
+
formatters:
|
87 |
+
simple:
|
88 |
+
format: '[%(asctime)s][%(name)s][%(levelname)s] - %(message)s'
|
89 |
+
colorlog:
|
90 |
+
(): colorlog.ColoredFormatter
|
91 |
+
format: '[%(cyan)s%(asctime)s%(reset)s][%(blue)s%(name)s%(reset)s][%(log_color)s%(levelname)s%(reset)s]
|
92 |
+
- %(message)s'
|
93 |
+
log_colors:
|
94 |
+
DEBUG: purple
|
95 |
+
INFO: green
|
96 |
+
WARNING: yellow
|
97 |
+
ERROR: red
|
98 |
+
CRITICAL: red
|
99 |
+
handlers:
|
100 |
+
console:
|
101 |
+
class: logging.StreamHandler
|
102 |
+
formatter: colorlog
|
103 |
+
stream: ext://sys.stdout
|
104 |
+
file:
|
105 |
+
class: logging.FileHandler
|
106 |
+
formatter: simple
|
107 |
+
filename: ${hydra.runtime.output_dir}/${task_name}.log
|
108 |
+
root:
|
109 |
+
level: INFO
|
110 |
+
handlers:
|
111 |
+
- console
|
112 |
+
- file
|
113 |
+
disable_existing_loggers: false
|
114 |
+
env: {}
|
115 |
+
mode: RUN
|
116 |
+
searchpath: []
|
117 |
+
callbacks: {}
|
118 |
+
output_subdir: .hydra
|
119 |
+
overrides:
|
120 |
+
hydra:
|
121 |
+
- hydra.mode=RUN
|
122 |
+
task: []
|
123 |
+
job:
|
124 |
+
name: hydra_test2
|
125 |
+
chdir: null
|
126 |
+
override_dirname: ''
|
127 |
+
id: ???
|
128 |
+
num: ???
|
129 |
+
config_name: train
|
130 |
+
env_set: {}
|
131 |
+
env_copy: []
|
132 |
+
config:
|
133 |
+
override_dirname:
|
134 |
+
kv_sep: '='
|
135 |
+
item_sep: ','
|
136 |
+
exclude_keys: []
|
137 |
+
runtime:
|
138 |
+
version: 1.3.2
|
139 |
+
version_base: '1.1'
|
140 |
+
cwd: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws
|
141 |
+
config_sources:
|
142 |
+
- path: hydra.conf
|
143 |
+
schema: pkg
|
144 |
+
provider: hydra
|
145 |
+
- path: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/configs
|
146 |
+
schema: file
|
147 |
+
provider: main
|
148 |
+
- path: hydra_plugins.hydra_colorlog.conf
|
149 |
+
schema: pkg
|
150 |
+
provider: hydra-colorlog
|
151 |
+
- path: ''
|
152 |
+
schema: structured
|
153 |
+
provider: schema
|
154 |
+
output_dir: /mnt/batch/tasks/shared/LS_root/mounts/clusters/soutrik-vm-dev/code/Users/Soutrik.Chowdhury/pytorch-template-aws/logs/train/runs/2024-11-08_15-37-45
|
155 |
+
choices:
|
156 |
+
debug: null
|
157 |
+
experiment: catdog_experiment
|
158 |
+
hydra: default
|
159 |
+
paths: catdog
|
160 |
+
trainer: default
|
161 |
+
logger: default
|
162 |
+
callbacks: default
|
163 |
+
model: catdog_classifier
|
164 |
+
data: catdog
|
165 |
+
hydra/env: default
|
166 |
+
hydra/callbacks: null
|
167 |
+
hydra/job_logging: colorlog
|
168 |
+
hydra/hydra_logging: colorlog
|
169 |
+
hydra/hydra_help: default
|
170 |
+
hydra/help: default
|
171 |
+
hydra/sweeper: basic
|
172 |
+
hydra/launcher: basic
|
173 |
+
hydra/output: default
|
174 |
+
verbose: false
|
logs/train/runs/2024-11-08_15-37-45/.hydra/overrides.yaml
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[]
|
logs/train/runs/2024-11-08_15-37-45/train.log
ADDED
File without changes
|
src/hydra_test.py
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import hydra
|
2 |
+
from omegaconf import DictConfig, OmegaConf
|
3 |
+
import rootutils
|
4 |
+
from dotenv import load_dotenv, find_dotenv
|
5 |
+
|
6 |
+
# Load environment variables
|
7 |
+
load_dotenv(find_dotenv(".env"))
|
8 |
+
|
9 |
+
# Setup root directory
|
10 |
+
root = rootutils.setup_root(__file__, indicator=".project-root", pythonpath=True)
|
11 |
+
|
12 |
+
|
13 |
+
# Define separate functions for each sub-configuration
|
14 |
+
def print_data(data_cfg: DictConfig):
|
15 |
+
print("Data Configuration:")
|
16 |
+
print(OmegaConf.to_yaml(data_cfg))
|
17 |
+
|
18 |
+
|
19 |
+
def print_model(model_cfg: DictConfig):
|
20 |
+
print("Model Configuration:")
|
21 |
+
print(OmegaConf.to_yaml(model_cfg))
|
22 |
+
|
23 |
+
|
24 |
+
def print_callbacks(callbacks_cfg: DictConfig):
|
25 |
+
print("Callbacks Configuration:")
|
26 |
+
print(OmegaConf.to_yaml(callbacks_cfg))
|
27 |
+
|
28 |
+
|
29 |
+
def print_logger(logger_cfg: DictConfig):
|
30 |
+
print("Logger Configuration:")
|
31 |
+
print(OmegaConf.to_yaml(logger_cfg))
|
32 |
+
|
33 |
+
|
34 |
+
def print_trainer(trainer_cfg: DictConfig):
|
35 |
+
print("Trainer Configuration:")
|
36 |
+
print(OmegaConf.to_yaml(trainer_cfg))
|
37 |
+
|
38 |
+
|
39 |
+
def print_paths(paths_cfg: DictConfig):
|
40 |
+
print("Paths Configuration:")
|
41 |
+
print(OmegaConf.to_yaml(paths_cfg))
|
42 |
+
|
43 |
+
|
44 |
+
@hydra.main(config_path="../configs", config_name="train", version_base="1.1")
|
45 |
+
def hydra_test(cfg: DictConfig):
|
46 |
+
# Print the full configuration
|
47 |
+
print("Full Configuration:")
|
48 |
+
print(OmegaConf.to_yaml(cfg))
|
49 |
+
|
50 |
+
# Call each function with the corresponding sub-configuration
|
51 |
+
print_data(cfg.data)
|
52 |
+
print_model(cfg.model)
|
53 |
+
print_callbacks(cfg.callbacks)
|
54 |
+
print_logger(cfg.logger)
|
55 |
+
print_trainer(cfg.trainer)
|
56 |
+
print_paths(cfg.paths)
|
57 |
+
|
58 |
+
|
59 |
+
if __name__ == "__main__":
|
60 |
+
hydra_test()
|
src/hydra_test2.py
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import hydra
|
2 |
+
from omegaconf import DictConfig, OmegaConf
|
3 |
+
import rootutils
|
4 |
+
from dotenv import load_dotenv, find_dotenv
|
5 |
+
|
6 |
+
# Load environment variables
|
7 |
+
load_dotenv(find_dotenv(".env"))
|
8 |
+
|
9 |
+
# Setup root directory
|
10 |
+
root = rootutils.setup_root(__file__, indicator=".project-root", pythonpath=True)
|
11 |
+
|
12 |
+
|
13 |
+
# Define a ModelCheckpoint class that takes in parameters as specified in cfg.callbacks.model_checkpoint
|
14 |
+
class ModelCheckpoint:
|
15 |
+
def __init__(
|
16 |
+
self,
|
17 |
+
dirpath,
|
18 |
+
filename,
|
19 |
+
monitor,
|
20 |
+
verbose=False,
|
21 |
+
save_last=True,
|
22 |
+
save_top_k=1,
|
23 |
+
mode="max",
|
24 |
+
auto_insert_metric_name=False,
|
25 |
+
save_weights_only=False,
|
26 |
+
every_n_train_steps=None,
|
27 |
+
train_time_interval=None,
|
28 |
+
every_n_epochs=None,
|
29 |
+
save_on_train_epoch_end=None,
|
30 |
+
):
|
31 |
+
self.dirpath = dirpath
|
32 |
+
self.filename = filename
|
33 |
+
self.monitor = monitor
|
34 |
+
self.verbose = verbose
|
35 |
+
self.save_last = save_last
|
36 |
+
self.save_top_k = save_top_k
|
37 |
+
self.mode = mode
|
38 |
+
self.auto_insert_metric_name = auto_insert_metric_name
|
39 |
+
self.save_weights_only = save_weights_only
|
40 |
+
self.every_n_train_steps = every_n_train_steps
|
41 |
+
self.train_time_interval = train_time_interval
|
42 |
+
self.every_n_epochs = every_n_epochs
|
43 |
+
self.save_on_train_epoch_end = save_on_train_epoch_end
|
44 |
+
|
45 |
+
def display(self):
|
46 |
+
print("Initialized ModelCheckpoint with the following configuration:")
|
47 |
+
for attr, value in self.__dict__.items():
|
48 |
+
print(f"{attr}: {value}")
|
49 |
+
|
50 |
+
|
51 |
+
# Define func4 to initialize the ModelCheckpoint class using cfg.callbacks.model_checkpoint
|
52 |
+
def func4(**kwargs):
|
53 |
+
# Initialize ModelCheckpoint with the kwargs
|
54 |
+
checkpoint = ModelCheckpoint(**kwargs)
|
55 |
+
checkpoint.display() # Display the configuration for confirmation
|
56 |
+
|
57 |
+
|
58 |
+
@hydra.main(config_path="../configs", config_name="train", version_base="1.1")
|
59 |
+
def hydra_test(cfg: DictConfig):
|
60 |
+
# Print the full configuration
|
61 |
+
print("Full Configuration:")
|
62 |
+
|
63 |
+
# Call func4 with the model checkpoint configuration
|
64 |
+
func4(**cfg.callbacks.model_checkpoint)
|
65 |
+
|
66 |
+
|
67 |
+
if __name__ == "__main__":
|
68 |
+
hydra_test()
|
src/models/catdog_model.py
ADDED
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import lightning as L
|
2 |
+
import torch
|
3 |
+
from torch import nn, optim
|
4 |
+
from torchmetrics import Accuracy, Precision, Recall, F1Score
|
5 |
+
from timm.models import VisionTransformer
|
6 |
+
|
7 |
+
|
8 |
+
class ViTTinyClassifier(L.LightningModule):
|
9 |
+
def __init__(
|
10 |
+
self,
|
11 |
+
img_size: int = 224,
|
12 |
+
num_classes: int = 2,
|
13 |
+
embed_dim: int = 64,
|
14 |
+
depth: int = 6,
|
15 |
+
num_heads: int = 2,
|
16 |
+
patch_size: int = 16,
|
17 |
+
mlp_ratio: float = 3.0,
|
18 |
+
pre_norm: bool = False,
|
19 |
+
lr: float = 1e-3,
|
20 |
+
weight_decay: float = 1e-5,
|
21 |
+
factor: float = 0.1,
|
22 |
+
patience: int = 10,
|
23 |
+
min_lr: float = 1e-6,
|
24 |
+
):
|
25 |
+
super().__init__()
|
26 |
+
self.save_hyperparameters()
|
27 |
+
|
28 |
+
# Create ViT model
|
29 |
+
self.model = VisionTransformer(
|
30 |
+
img_size=img_size,
|
31 |
+
patch_size=patch_size,
|
32 |
+
in_chans=3,
|
33 |
+
num_classes=num_classes,
|
34 |
+
embed_dim=embed_dim,
|
35 |
+
depth=depth,
|
36 |
+
num_heads=num_heads,
|
37 |
+
mlp_ratio=mlp_ratio,
|
38 |
+
qkv_bias=False,
|
39 |
+
pre_norm=pre_norm,
|
40 |
+
global_pool="token",
|
41 |
+
)
|
42 |
+
|
43 |
+
# Metrics for multi-class classification
|
44 |
+
metrics = {
|
45 |
+
"accuracy": Accuracy(task="multiclass", num_classes=num_classes),
|
46 |
+
"precision": Precision(
|
47 |
+
task="multiclass", num_classes=num_classes, average="macro"
|
48 |
+
),
|
49 |
+
"recall": Recall(
|
50 |
+
task="multiclass", num_classes=num_classes, average="macro"
|
51 |
+
),
|
52 |
+
"f1": F1Score(task="multiclass", num_classes=num_classes, average="macro"),
|
53 |
+
}
|
54 |
+
|
55 |
+
# Initialize metrics for each stage
|
56 |
+
self.train_metrics = nn.ModuleDict(
|
57 |
+
{name: metric.clone() for name, metric in metrics.items()}
|
58 |
+
)
|
59 |
+
self.val_metrics = nn.ModuleDict(
|
60 |
+
{name: metric.clone() for name, metric in metrics.items()}
|
61 |
+
)
|
62 |
+
self.test_metrics = nn.ModuleDict(
|
63 |
+
{name: metric.clone() for name, metric in metrics.items()}
|
64 |
+
)
|
65 |
+
|
66 |
+
# Loss function
|
67 |
+
self.criterion = nn.CrossEntropyLoss()
|
68 |
+
|
69 |
+
def forward(self, x):
|
70 |
+
return self.model(x)
|
71 |
+
|
72 |
+
def _shared_step(self, batch, stage: str):
|
73 |
+
x, y = batch
|
74 |
+
logits = self(x)
|
75 |
+
loss = self.criterion(logits, y)
|
76 |
+
preds = logits.argmax(dim=1)
|
77 |
+
|
78 |
+
# Get appropriate metric dictionary based on stage
|
79 |
+
metrics = getattr(self, f"{stage}_metrics")
|
80 |
+
metric_logs = {
|
81 |
+
f"{stage}_{name}": metric(preds, y) for name, metric in metrics.items()
|
82 |
+
}
|
83 |
+
|
84 |
+
# Log metrics
|
85 |
+
self.log(f"{stage}_loss", loss, prog_bar=True)
|
86 |
+
self.log_dict(metric_logs, prog_bar=True, on_step=False, on_epoch=True)
|
87 |
+
return loss
|
88 |
+
|
89 |
+
def training_step(self, batch, batch_idx):
|
90 |
+
return self._shared_step(batch, "train")
|
91 |
+
|
92 |
+
def validation_step(self, batch, batch_idx):
|
93 |
+
self._shared_step(batch, "val")
|
94 |
+
|
95 |
+
def test_step(self, batch, batch_idx):
|
96 |
+
self._shared_step(batch, "test")
|
97 |
+
|
98 |
+
def configure_optimizers(self):
|
99 |
+
optimizer = optim.AdamW(
|
100 |
+
self.parameters(),
|
101 |
+
lr=self.hparams.lr,
|
102 |
+
weight_decay=self.hparams.weight_decay,
|
103 |
+
)
|
104 |
+
|
105 |
+
scheduler = optim.lr_scheduler.ReduceLROnPlateau(
|
106 |
+
optimizer,
|
107 |
+
factor=self.hparams.factor,
|
108 |
+
patience=self.hparams.patience,
|
109 |
+
min_lr=self.hparams.min_lr,
|
110 |
+
)
|
111 |
+
|
112 |
+
return {
|
113 |
+
"optimizer": optimizer,
|
114 |
+
"lr_scheduler": {
|
115 |
+
"scheduler": scheduler,
|
116 |
+
"monitor": "val_loss",
|
117 |
+
"interval": "epoch",
|
118 |
+
},
|
119 |
+
}
|
src/utils/logging_utils.py
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
import os
|
3 |
+
from pathlib import Path
|
4 |
+
from functools import wraps
|
5 |
+
|
6 |
+
from loguru import logger
|
7 |
+
from rich.progress import Progress, SpinnerColumn, TextColumn
|
8 |
+
|
9 |
+
|
10 |
+
def setup_logger(log_file):
|
11 |
+
"""Set up the logger with a file and console handler."""
|
12 |
+
os.makedirs(Path(log_file).parent, exist_ok=True)
|
13 |
+
logger.remove()
|
14 |
+
logger.add(
|
15 |
+
sys.stderr,
|
16 |
+
format="<green>{time:YYYY-MM-DD HH:mm:ss}</green> | <level>{level: <8}</level> | <cyan>{name}</cyan>:<cyan>{function}</cyan>:<cyan>{line}</cyan> - <level>{message}</level>",
|
17 |
+
)
|
18 |
+
logger.add(log_file, rotation="1MB")
|
19 |
+
|
20 |
+
|
21 |
+
def task_wrapper(func):
|
22 |
+
"""Wrapper to log the start and end of a task."""
|
23 |
+
|
24 |
+
@wraps(func)
|
25 |
+
def wrapper(*args, **kwargs):
|
26 |
+
func_name = func.__name__
|
27 |
+
logger.info(f"Starting {func_name}")
|
28 |
+
try:
|
29 |
+
result = func(*args, **kwargs)
|
30 |
+
logger.info(f"Finished {func_name}")
|
31 |
+
return result
|
32 |
+
except Exception as e:
|
33 |
+
logger.exception(f"Error in {func_name}: {str(e)}")
|
34 |
+
raise
|
35 |
+
|
36 |
+
return wrapper
|
37 |
+
|
38 |
+
|
39 |
+
def get_rich_progress():
|
40 |
+
"""Get a Rich Progress object."""
|
41 |
+
return Progress(
|
42 |
+
SpinnerColumn(),
|
43 |
+
TextColumn("[progress.description]{task.description}"),
|
44 |
+
transient=True,
|
45 |
+
)
|