pretrained¶
- class pretrained(url)[source]¶
Decorator which helps to download pretrained weights from the given url. Including fs, s3, http(s).
For example, we can decorate a resnet18 function as follows
@hub.pretrained("https://url/to/pretrained_resnet18.pkl") def resnet18(**kwargs):
- Returns
When decorated function is called with
pretrained=True
, MegEngine will automatically download and fill the returned model with pretrained weights.