megengine.hub.load¶
-
load
(repo_info, entry, *args, git_host='github.com', use_cache=True, commit=None, protocol='HTTPS', **kwargs)[源代码]¶ 从GitHub或GitLab中加载具有预训练权重的模型。
- 参数
repo_info (
str
) – 格式为"repo_owner/repo_name[:tag_name/:branch_name]"
的字符串,其中tag/branch是可选的。 若不指明,则默认分支是master
。 例如:"brain_sdk/MegBrain[:hub]"
entry (
str
) – 一个在hubconf中定义的入口点。git_host (
str
) – git repo的主机地址。例如:github.comuse_cache (
bool
) – 选择使用本地缓存的代码或完全重新拉取代码。protocol (
str
) – 获得代码仓库所使用的协议,其中,HTTPS协议只支持github公共仓库。该参数值可为HTTPS 或 SSH。
- 返回类型
- 返回
单个模型,具有对应的预训练的权重。