MindSpore Hub 文档
MindSpore Hub是MindSpore生态的预训练模型应用工具。
MindSpore Hub包含以下功能:
即插即用的模型加载
简单易用的迁移学习
import mindspore
import mindspore_hub as mshub
from mindspore import context
context.set_context(mode=context.GRAPH_MODE,
device_target="Ascend",
device_id=0)
model = "mindspore/ascend/0.7/googlenet_v1_cifar10"
# Initialize the number of classes based on the pre-trained model.
network = mshub.load(model, num_classes=10)
network.set_train(False)
# ...