Skip to content

【开源实习】香橙派github仓中的在线推理案例05-ShuffleNet基于PyNative模式改写成以mint接口实现#107

Open
ym628 wants to merge 2 commits into
candle-org:masterfrom
ym628:pull
Open

【开源实习】香橙派github仓中的在线推理案例05-ShuffleNet基于PyNative模式改写成以mint接口实现#107
ym628 wants to merge 2 commits into
candle-org:masterfrom
ym628:pull

Conversation

@ym628

@ym628 ym628 commented Oct 13, 2025

Copy link
Copy Markdown

任务
任务编号:#ICJ91O
任务链接:【开源实习】香橙派github仓中的在线推理案例05-ShuffleNet基于PyNative模式改写成以mint接口实现
版本信息:
Python 3.9 + MindSpore 2.6.0 + CANN 8.1.RC1
OrangePi AiPro 8G 8T

实现内容:
香橙派github仓中在线推理案例 05-ShuffleNet 基于MindSpore2.6.0的PyNative模式下可以在香橙派开发板正常流畅运行。

推理正常:
image

补充:
mindspore.mint.transpose(x, 2, 1)在CANN 8.1.RC1中会提示缺少算子,在CANN 8.1.RC1.beta1中可以正常运行
4b57bc03102e726243879f8ca085b168

@cui0523

cui0523 commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

部分方法没有修改成mint接口,包括但不限于nn.BatchNorm2d,nn.Conv2d等,需要再排查一遍以确保全部可以替换的均替换成mint接口实现。

@cui0523

cui0523 commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

案例中“运行环境设置”部分不必要的设置还是没有删除,尤其要求是动态图模式下执行该案例,只需要保留混合精度的设置ascend.op_precision.precision_mode("allow_mix_precision")。
参照案例https://github.com/JoeLiao0/orange-pi-mindspore/blob/735271b50e52a680df393b490e4677e8300ee599/Online/inference/10-DCGAN/mindspore_dcgan.ipynb

@cui0523

cui0523 commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

目录orange-pi-mindspore,orange-pi-mindspore/Online, orange-pi-mindspore/Online/inference下的readme中均需修改案例版本信息

@cui0523

cui0523 commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

mindspore.mint.transpose(x, 2, 1)在CANN 8.1.RC1中会提示缺少算子,在CANN 8.1.RC1.beta1中可以正常运行--------针对这个问题transpose接口保持原接口实现即可

@ym628

ym628 commented Oct 14, 2025

Copy link
Copy Markdown
Author

.BatchNorm2d
老师,在修改nn.BatchNorm2d以后会影响精度

image image

@cui0523

cui0523 commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

修改nn.BatchNorm2d以后会影响精度---针对这个问题,基于nn.BatchNorm2d和mint.nn.BatchNorm2d构造下单算子用例,然后同样的输入,开确定性,比一下输出

@cui0523

cui0523 commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

验收通过,可以合入

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants