-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul of train.py and adding Chesapeake CVPR trainer #103
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
e57109b
Refactoring how the trainer modules are called from train.py and how …
calebrob6 fba6506
Turning off pin_memory to avoid some annoying warning messages
calebrob6 625ef06
Changing how the ChesapeakeCVPR dataset returns samples
calebrob6 2a1382e
Working draft of trainer
calebrob6 b71ad1d
Now stuff trains
calebrob6 8cdb422
Formatting
calebrob6 69c7bc4
Fixing tests
calebrob6 6307709
Adding example configuration file for the Chesapeake CVPR dataset
calebrob6 04d7c27
Some weird corner case fixes
calebrob6 58782d9
Checksum false fix
calebrob6 6d825f2
Some modifications to conf files
calebrob6 f66fd02
Changes to fix Cyclone
calebrob6 9a180e6
Adding an empty line to conf files
calebrob6 9780216
Getting rid of pin_memory=False and proper typing of kwargs
calebrob6 5ac51ed
Some docstrings
calebrob6 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
trainer: | ||
gpus: 1 # single GPU training | ||
min_epochs: 20 | ||
max_epochs: 100 | ||
benchmark: True | ||
|
||
experiment: | ||
task: "chesapeake_cvpr" | ||
name: "chesapeake_cvpr_example" | ||
module: | ||
loss: "ce" # cross entropy loss | ||
segmentation_model: "unet" | ||
encoder_name: "resnet18" | ||
encoder_weights: null # use ImageNet weight initialization | ||
encoder_output_stride: 16 | ||
optimizer: "adamw" | ||
learning_rate: 1e-2 | ||
learning_rate_schedule_patience: 2 | ||
datamodule: | ||
batch_size: 32 | ||
num_workers: 4 | ||
train_state: "de" # train/val/test in Delaware |
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,11 +1,18 @@ | ||
program: # These are experiment level arguments | ||
experiment_name: cyclone_test | ||
program: # These are the arguments that define how the train.py script works | ||
seed: 1337 | ||
overwrite: True | ||
|
||
trainer: # These are all the arguments that will be passed to the pl.Trainer | ||
min_epochs: 15 | ||
experiment: | ||
task: "cyclone" | ||
name: cyclone_test | ||
module: | ||
model: "resnet18" | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
datamodule: | ||
batch_size: 32 | ||
num_workers: 4 | ||
|
||
task: # These are all the arguments that will be used to create an appropriate task | ||
name: cyclone | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
trainer: | ||
min_epochs: 15 | ||
gpus: 1 |
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,14 @@ | ||
experiment: | ||
task: "chesapeake_cvpr" | ||
module: | ||
loss: "ce" | ||
segmentation_model: "unet" | ||
encoder_name: "resnet18" | ||
encoder_weights: "imagenet" | ||
encoder_output_stride: 16 | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
datamodule: | ||
batch_size: 32 | ||
num_workers: 4 | ||
train_state: "de" |
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,9 @@ | ||
task: | ||
name: "cyclone" | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
model: "resnet18" | ||
experiment: | ||
task: "cyclone" | ||
module: | ||
model: "resnet18" | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
datamodule: | ||
batch_size: 32 | ||
num_workers: 4 |
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,10 +1,14 @@ | ||
task: | ||
name: "landcoverai" | ||
optimizer: "adamw" | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
loss: "ce" | ||
segmentation_model: "deeplabv3+" | ||
encoder_name: "resnet34" | ||
encoder_weights: "imagenet" | ||
encoder_output_stride: 16 | ||
experiment: | ||
task: "landcoverai" | ||
module: | ||
loss: "ce" | ||
segmentation_model: "deeplabv3+" | ||
encoder_name: "resnet34" | ||
encoder_weights: "imagenet" | ||
encoder_output_stride: 16 | ||
optimizer: "adamw" | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
datamodule: | ||
batch_size: 32 | ||
num_workers: 4 |
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,10 +1,14 @@ | ||
task: | ||
name: "naipchesapeake" | ||
optimizer: "adamw" | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
loss: "ce" | ||
segmentation_model: "deeplabv3+" | ||
encoder_name: "resnet34" | ||
encoder_weights: "imagenet" | ||
encoder_output_stride: 16 | ||
experiment: | ||
task: "naipchesapeake" | ||
module: | ||
loss: "ce" | ||
segmentation_model: "deeplabv3+" | ||
encoder_name: "resnet34" | ||
encoder_weights: "imagenet" | ||
encoder_output_stride: 16 | ||
optimizer: "adamw" | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
datamodule: | ||
batch_size: 32 | ||
num_workers: 4 |
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,8 +1,13 @@ | ||
task: | ||
name: "sen12ms" | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
loss: "ce" | ||
segmentation_model: "unet" | ||
encoder_name: "resnet18" | ||
encoder_weights: "imagenet" | ||
experiment: | ||
task: "sen12ms" | ||
module: | ||
loss: "ce" | ||
segmentation_model: "unet" | ||
encoder_name: "resnet18" | ||
encoder_weights: "imagenet" | ||
encoder_output_stride: 16 | ||
learning_rate: 1e-3 | ||
learning_rate_schedule_patience: 2 | ||
datamodule: | ||
batch_size: 32 | ||
num_workers: 4 |
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My biggest complaint about all this OmegaConf stuff is that there doesn't seem to be any documentation on what options are supported or what possible values they can take. There's no way to get a help message without argparse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is discussed in much more detail here -- facebookresearch/hydra#633.
For now I think comments in the yaml files are OK -- we can do more here. I think there will be few scenarios in which a user is trying to configure experiments without looking at the trainer code.