-
Couldn't load subscription status.
- Fork 480
Closed
Copy link
Labels
scriptsTraining and evaluation scriptsTraining and evaluation scriptstrainersPyTorch Lightning trainersPyTorch Lightning trainers
Description
Description
Using the Lightning CLI we can train the SemanticSegmentationTask, but cannot use class_weights without an error. Solution is to accept a list if int in addition to tensor
Steps to reproduce
In Lightning CLI Yaml:
model:
class_path: SemanticSegmentationTask
init_args:
model: unet
backbone: resnet50
weights: null
lr: 0.001
in_channels: 6
num_classes: 2
class_weights:
- 1
- 50
Will result in
Does not validate against any of the Union subtypes
Subtypes: (<class 'torch.Tensor'>, <class 'NoneType'>)
Errors:
- Not a valid subclass of Tensor
Subclass types expect one of:
- a class path (str)
- a dict with class_path entry
- a dict without class_path but with init_args entry (class path given previously)
- Expected a <class 'NoneType'>
Given value type: <class 'list'>
Given value: [1, 50]
Version
main
isaaccorley
Metadata
Metadata
Assignees
Labels
scriptsTraining and evaluation scriptsTraining and evaluation scriptstrainersPyTorch Lightning trainersPyTorch Lightning trainers