tinyms.hub¶
-
tinyms.hub.
load
(uid, pretrained=True, **kwargs)[source]¶ Load a model from remote TinyMS Hub.
- Parameters
- Returns
layers.Layer, the initialized network instance.
Examples
>>> from tinyms import hub >>> >>> hub.load('tinyms/0.2/lenet5_v1_mnist', class_num=10)
-
tinyms.hub.
load_checkpoint
(uid, dst, pretrained=True, **kwargs)[source]¶ Load model checkpoint file from remote TinyMS Hub.
- Parameters
uid (str) – Uid. The format should be strictly consistent with the official example: tinyms/0.2/lenet5_v1_mnist.
dst (str) – Full path of filename where the checkpoint file will be loaded, e.g. /tmp/lenet5.ckpt.
pretrained (bool) – Specified if to load pretrained weight ckpt file. Default: True.
kwargs (dict, optional) – Keyword arguments for network initialization.
Examples
>>> from tinyms import hub >>> >>> hub.load_checkpoint('tinyms/0.2/lenet5_v1_mnist', '/tmp/lenet5.ckpt', class_num=10)
-
tinyms.hub.
load_weights
(uid)[source]¶ Load model pretrained weights from remote TinyMS Hub.
- Parameters
uid (str) – Uid. The format should be strictly consistent with the official example: tinyms/0.2/lenet5_v1_mnist.
- Returns
Dict, the pretrained network weight dict.
Examples
>>> from tinyms import hub >>> from tinyms.model import lenet5 >>> from tinyms.utils.train import load_param_into_net >>> >>> param_dict = hub.load_weights('tinyms/0.2/lenet5_v1_mnist') >>> net = lenet5() >>> load_param_into_net(net, param_dict)