generated from ashleve/lightning-hydra-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge pull request #83 from DIVA-DIA/dev_resnet
Created resnet FCN header
- Loading branch information
Showing
15 changed files
with
274 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
configs/experiment/dev_rotnet_pt_resnet18_cb55_10_segmentation.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# @package _global_ | ||
|
||
# to execute this experiment run: | ||
# python run.py +experiment=exp_example_full | ||
|
||
defaults: | ||
- /plugins: default.yaml | ||
- /task: semantic_segmentation_HisDB.yaml | ||
- /loss: crossentropyloss.yaml | ||
- /metric: hisdbiou.yaml | ||
- /model/backbone: resnet18.yaml | ||
- /model/header: resnet_segmentation.yaml | ||
- /optimizer: adam.yaml | ||
- /callbacks: | ||
- check_compatibility.yaml | ||
- model_checkpoint.yaml | ||
- watch_model_wandb.yaml | ||
- /logger: | ||
- wandb.yaml # set logger here or use command line (e.g. `python run.py logger=wandb`) | ||
- csv.yaml | ||
|
||
# we override default configurations with nulls to prevent them from loading at all | ||
# instead we define all modules and their paths directly in this config, | ||
# so everything is stored in one place for more readibility | ||
|
||
seed: 42 | ||
|
||
train: True | ||
test: False | ||
|
||
trainer: | ||
_target_: pytorch_lightning.Trainer | ||
gpus: -1 | ||
accelerator: 'ddp' | ||
min_epochs: 1 | ||
max_epochs: 3 | ||
weights_summary: full | ||
precision: 16 | ||
|
||
task: | ||
confusion_matrix_log_every_n_epoch: 1 | ||
confusion_matrix_val: True | ||
confusion_matrix_test: True | ||
|
||
datamodule: | ||
_target_: src.datamodules.DivaHisDB.datamodule_cropped.DivaHisDBDataModuleCropped | ||
|
||
data_dir: /netscratch/datasets/semantic_segmentation/datasets_cropped/CB55-10-segmentation | ||
crop_size: 256 | ||
num_workers: 4 | ||
batch_size: 16 | ||
shuffle: True | ||
drop_last: True | ||
data_folder_name: data | ||
gt_folder_name: gt | ||
|
||
model: | ||
backbone: | ||
path_to_weights: /netscratch/experiments_lars_paul/lars/2021-11-15/16-08-51/checkpoints/epoch=1/backbone.pth | ||
header: | ||
in_channels: 512 | ||
|
||
callbacks: | ||
model_checkpoint: | ||
filename: ${checkpoint_folder_name}dev-rotnet-pt-resnet18-cb55-10-segmentation | ||
watch_model: | ||
log_freq: 1 | ||
|
||
logger: | ||
wandb: | ||
name: 'dev-rotnet-pt-resnet18-cb55-10-segmetnation' | ||
tags: [ "best_model", "USL" ] | ||
group: 'dev-runs' | ||
notes: "Testing" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# @package _global_ | ||
|
||
# to execute this experiment run: | ||
# python run.py +experiment=exp_example_full | ||
|
||
defaults: | ||
- /plugins: default.yaml | ||
- /task: classification.yaml | ||
- /loss: crossentropyloss.yaml | ||
- /metric: accuracy.yaml | ||
- /model/backbone: resnet50.yaml | ||
- /model/header: resnet_classification.yaml | ||
- /optimizer: adam.yaml | ||
- /callbacks: | ||
- check_compatibility.yaml | ||
- model_checkpoint.yaml | ||
- watch_model_wandb.yaml | ||
- /logger: | ||
- wandb.yaml # set logger here or use command line (e.g. `python run.py logger=wandb`) | ||
- csv.yaml | ||
|
||
# we override default configurations with nulls to prevent them from loading at all | ||
# instead we define all modules and their paths directly in this config, | ||
# so everything is stored in one place for more readibility | ||
|
||
seed: 42 | ||
|
||
train: True | ||
test: False | ||
|
||
trainer: | ||
_target_: pytorch_lightning.Trainer | ||
gpus: -1 | ||
accelerator: 'ddp' | ||
min_epochs: 1 | ||
max_epochs: 3 | ||
weights_summary: full | ||
precision: 16 | ||
|
||
task: | ||
confusion_matrix_log_every_n_epoch: 1 | ||
confusion_matrix_val: False | ||
confusion_matrix_test: False | ||
|
||
datamodule: | ||
_target_: src.datamodules.RotNet.datamodule_cropped.RotNetDivaHisDBDataModuleCropped | ||
|
||
data_dir: /netscratch/datasets/semantic_segmentation/datasets_cropped/CB55-10-segmentation | ||
crop_size: 256 | ||
num_workers: 4 | ||
batch_size: 16 | ||
shuffle: True | ||
drop_last: True | ||
data_folder_name: data | ||
|
||
model: | ||
header: | ||
# needs to be calculated from the output of the last layer of the backbone (do not forget to flatten!) | ||
in_channels: 131072 | ||
|
||
callbacks: | ||
model_checkpoint: | ||
filename: ${checkpoint_folder_name}dev-rotnet-resnet50-cb55-10 | ||
watch_model: | ||
log_freq: 1 | ||
|
||
logger: | ||
wandb: | ||
name: 'dev-rotnet-resnet50-cb55-10' | ||
tags: [ "best_model", "USL" ] | ||
group: 'dev-runs' | ||
notes: "Testing" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
configs/model/header/single_layer.yaml → ...s/model/header/resnet_classification.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
_target_: src.models.headers.fully_connected.SingleLinear | ||
_target_: src.models.headers.fully_connected.ResNetHeader | ||
|
||
num_classes: ${datamodule:num_classes} | ||
# needs to be calculated from the output of the last layer of the backbone (do not forget to flatten!) | ||
input_size: 109512 | ||
in_channels: 109512 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
_target_: src.models.headers.fully_convolution.ResNetFCNHead | ||
|
||
#FCN header for resnets. The in_channels are fixed for the different resnet architectures: | ||
#resnet18, 34 = 512 | ||
#resnet50, 101, 152 = 2048 | ||
in_channels: 512 | ||
num_classes: ${datamodule:num_classes} | ||
output_dims: ${datamodule:dims} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
# --------- pytorch --------- # | ||
torch==1.8.1 | ||
torchvision>=0.9.1 | ||
pytorch-lightning>=1.4.4 | ||
lightning-bolts>=0.3.2 | ||
torchmetrics>=0.5.0 | ||
torchvision==0.9.1 | ||
pytorch-lightning==1.4.8 | ||
lightning-bolts==0.4.0 | ||
torchmetrics==0.5.1 | ||
|
||
# --------- hydra --------- # | ||
hydra-core==1.1.0 | ||
hydra-colorlog==1.1.0 | ||
hydra-optuna-sweeper==1.1.0 | ||
|
||
# --------- loggers --------- # | ||
wandb>=0.10.31 | ||
wandb==0.12.6 | ||
|
||
# --------- others --------- # | ||
rich | ||
python-dotenv | ||
pre-commit | ||
scikit-learn>=0.23.2 | ||
pandas | ||
matplotlib | ||
seaborn | ||
pytest | ||
rich==10.1.0 | ||
python-dotenv==0.17.0 | ||
scikit-learn==0.24.1 | ||
pandas==1.2.4 | ||
matplotlib==3.4.1 | ||
seaborn==0.11.1 | ||
pytest==6.2.3 |
Oops, something went wrong.