Giter VIP home page Giter VIP logo

mindspore_hccr's Introduction

使用MindSpore训练CNN手写汉字识别

完整效果

t

整体训练流程

代码说明

code
└── data_preprocessing
	├── gnt2gnt.cpp                     # 数据预处理
	└── gnt2tf.py                       # 制作tfrecord数据集以供mindspore训练
└── train&eval
	├── config.py                       # 配置文件
	├── dataset.py                      # 数据载入及预处理
	├── eval.py                         # 批量验证测试集精度&导出pb模型
	├── lr_generator.py                 # 学习率设置
	├── train_with_eva.py               # 训练并验证精度
	├── inference.py              	    # 推理单张图片
	└── resnet.py                       # resnet18

图像预处理

该部分可参考手写汉字拍照识别系统,处理方法类似

网络模型ResNet-18

该部分使用标准resnet论文中的18层结构。由于手写汉字特征较为简单且三通道意义不大,因此将输入改为了112 * 112 * 1。

创建作业开始云端训练

选择华为云服务中的ModelArts;选择训练管理中的训练作业模块,点击“创建”。


在常用框架模块下进行设置,包括对代码目录、启动文件、数据存储位置和单卡多卡模式等。


在训练作业中选择一个任务进入,选择日志模块进行查看。若在本地配置了MindSpore,还可通过MindInsight可视化训练过程。

训练结果

mindspore的底层加速确实不错,同等参数训练比tensorflow要快一些。

模型导出

网络训练完成后,可进一步导出为GEIR或ONNX格式的PB模型,以便后续部署到Atlas或其它平台上进行推理。

mindspore_hccr's People

Contributors

huiyanwen avatar

Stargazers

 avatar YuYan avatar  avatar  avatar Ruiming Guo (郭睿明) avatar

Watchers

James Cloos avatar  avatar

Forkers

lswzjuer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.