This location is used for storage the documents for MindSpore Hub Website
Please note that publishing a model to MindSpore Hub is in "testing stage". If you are interested in publishing your own model to MindSpore Hub, please follow the directions below and we will process your submission as soon as possible. And the MindSpore Hub Website will be updated in less than 24 hours.
You should agree to the MindSpore Hub Terms before submitting a model into MindSpore Hub.
All the Model committed to the MindSpore Hub should use the Apache 2.0 License
Model uid is alphanumeric token, in the pattern of publisher/backend/mindspore_version/markdown_file_name
, in which markdown_file_name
is consisted of [model_name]_[model_version]_[dataset]
. Which could be the input of the hub.load
interface.
See example below:
UID | Url |
---|---|
mindspore/ascend/1.0/alexnet_v1_cifar10 | https://gitee.com/mindspore/hub/blob/master/mshub_res/assets/mindspore/ascend/1.0/alexnet_v1_cifar10.md |
UID | repo_path |
---|---|
mindspore/ascend/1.0/alexnet_v1_cifar10 | [repo_root]/mshub_res/assets/mindspore/ascend/1.0/alexnet_v1_cifar10.md |
We don't restrict the location of the model file. But we suggest you set the term of allow_cache_ckpt
to be true
in the markdown file you commit, so that we will cache the model file in our own file storage server to
accelerate the download and will try to optimize the model, speeding up for the Edge Devices, Mobile Phone for example.
The full process of publishing consists of:
mindspore_hub_conf.py
under the repoexamples
tools/md_validator.py
to self-checking the markdown file's pattern is good or notSee sections below for more details.
The MindSpore Hub repository supports multiple kinds of model file-formats, including:
This file is used to export the network definition to the hub interface. File location is listed below,
mobilenetv2
|- src
| └──mobilenetv2.py
|- script
| └──run_train.sh
|- train.py
|- test.py
|- mindspore_hub_conf.py
The Content in this file must include a function which name create_network
, this function's first args is the model name which is supported to create. This name's lower case should match the model_name
in markdown file.
You should check the values in *args
and **kwargs
.
import src.resnet as src_resnet
def resnet50(*args, **kwargs):
return src_resnet.resnet50(*args, **kwargs)
def resnet101(*args, **kwargs):
return src_resnet.resnet101(*args, **kwargs)
def create_network(name, *args, **kwargs):
if name == "resnet50":
return resnet50(*args, **kwargs)
elif name == "resnet101":
return resnet101(*args, **kwargs)
else:
raise NotImplementedError(f"{name} is not implemented in the repo")
If you want to publish your model in MindSpore Model Hub, you should commit a pull request, along with a markdown file. This markdown file can be split into two parts, first one is the meta information of the model, including the repo link and binary file link, these information will be shown in the MindSpore Hub Website. Second one is the detail information will be shown in the detail page in MindSpore Hub Website. You should make sure your Usage section can be run.
You can download the example markdown file in the examples/commit_example.md
, change the information accordingly. After that, you can use the check file tool in the tools
to check whether this markdown file is good or not.
The content in the markdown file should be the same as the example file. For example, we use ---
to split the file into two parts, first one is loaded by yaml format. The other is markdown format.
The asset
item is the list of dicts. So you should total use the same pattern to write the asset.
.../assets/publisher/...
..../assets/mindspore/ascend/1.0/...
.md
..../assets/mindspore/ascend/1.0/alexnet_v1_cifar10.md
assets
|────publisher
| └──publisher_intro.md
| └──ascend
| | └──1.0
| └──gpu
| └──1.0
| └──[model_name]_[model_version]_[dataset].md
| └──[model_name2]_[model_version2]_[dataset2].md
How to submit the model
After the right location of the markdown file is identified (see the Writing the documentation section above), the file can be pulled into the master branch of mindspore/hub
After adding the markdown file, you can use the validator tool in the mshub_res/tools/md_validator.py
to validate
the markdown file you write before you creating a pull request.
python mshub_res/tools/md_validator.py
You can add some images as static file in your pull request for showing in the markdown file. You can have static folder under your folder as a publisher.
assets
|────publisher
| └──publisher_intro.md
| └──ascend
| | └──1.0
| └──gpu
| | └──1.0
| | └──[model_name]_[model_version]_[dataset].md
| | └──[model_name2]_[model_version2]_[dataset2].md
| └──static
| └──images
| └──image1.jpg
|
|────publisher2
| └──publisher_intro.md
| └──ascend
| | └──1.0
| └──gpu
| | └──1.0
| | └──[model_name]_[model_version]_[dataset].md
| | └──[model_name2]_[model_version2]_[dataset2].md
| └──static
| └──images
| └──image1.jpg
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。