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