File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ The training script can train any supported model. You can override any configur
129
129
130
130
### Finetune using pretrained weights
131
131
``` bash
132
- ./train.py pretrained=parseq-tiny # Not all experiments have pretrained weights
132
+ ./train.py +experiment=parseq-tiny pretrained=parseq-tiny # Not all experiments have pretrained weights
133
133
```
134
134
135
135
### Train a model variant/preconfigured experiment
Original file line number Diff line number Diff line change @@ -77,7 +77,8 @@ def main(config: DictConfig):
77
77
model : BaseSystem = hydra .utils .instantiate (config .model )
78
78
# If specified, use pretrained weights to initialize the model
79
79
if config .pretrained is not None :
80
- model .load_state_dict (get_pretrained_weights (config .pretrained ))
80
+ m = model .model if config .model ._target_ .endswith ('PARSeq' ) else model
81
+ m .load_state_dict (get_pretrained_weights (config .pretrained ))
81
82
print (summarize (model , max_depth = 2 ))
82
83
83
84
datamodule : SceneTextDataModule = hydra .utils .instantiate (config .data )
You can’t perform that action at this time.
0 commit comments