基于Mindspore训练LeNet识别手写数字

100 阅读1分钟

转载地址:bbs.huaweicloud.com/forum/threa…

作者:呼哈呼哈

需要注意测试代码中是通过import以及getattr来加载网络的,如果修改了训练脚本的名称,对应的modulePath名称也需要修改

 # load the network definition

module = importlib.import_module(modulePath)

network = getattr(module, moduleName)()

否则无法加载网络,预测结果仍为32x32像素的图片,无法进行预测!