当前位置:网站首页>华为ModelArts训练Alexnet模型
华为ModelArts训练Alexnet模型
2022-07-01 07:15:00 【花花少年】
一、参考资料
二、关键步骤
2.1 上传源码到obs
.
|-- dataset # 数据集
| |-- train
| `-- val `-- train
|-- data.py
|-- model.py
`-- train_npu.py # 启动文件
2.2 obs创建目录
obs目录结构
log:日志存放路径
output:训练输出路径

2.3 创建算法
算法管理
---》创建
名称:自定义
描述:自定义
创建方式:自定义
AI引擎:tensorflow_1.15-cann_5.0.3-py_3.7-euler_2.8.3-aarch64
代码目录:/xxx/alexnet/train/
启动文件:/xxx/alexnet/train/train_npu.py
输入数据配置:数据集路径
映射名称:自定义(默认即可)
代码路径参数:data_url
输出数据配置:训练输出路径
映射名称:自定义(默认即可)
代码路径参数:train_url
其他:默认即可

2.4 创建训练作业
训练管理
---》训练作业
---》创建
名称:自定义
描述:自定义
算法:
---》我的算法
---》勾选刚创建的算法
训练输入:
---》data_url:/xxx/alexnet/dataset/
训练输出:
---》train_url:/xxx/alexnet/output/
资源池:根据实际需求
资源类型:Ascend
规格:根据实际需求
计算节点个数:根据实际需求
作业日志路径:/xxx/alexnet/log/

2.5 训练完成

三、FAQ
Q:The input shape of GeOp5_0 is dynamic
【南京大学】【MEMNET】【ID1085】 模型 npu迁移时报错: The input shape of GeOp5_0 is dynamic
File "/home/ma-user/modelarts/user-job-dir/train/train_npu.py", line 114, in main
test_loss, test_acc, summary = sess.run([cost, accuracy, summary_op], feed_dict=val_feed)
File "/home/ma-user/anaconda/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 956, in run
run_metadata_ptr)
File "/home/ma-user/anaconda/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "/home/ma-user/anaconda/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
run_metadata)
File "/home/ma-user/anaconda/lib/python3.7/site-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InternalError: The input shape of GeOp5_0 is dynamic, please ensure that npu option[dynamic_input] is set correctly, for more details please refer to the migration guide.
[[{
{
node GeOp5_0}}]]
错误原因:
模型训练过程中存在输入shape变化的问题
解决办法:
train_npu.py中添加
custom_op.parameter_map["dynamic_input"].b = True
custom_op.parameter_map["dynamic_graph_execute_mode"].s = tf.compat.as_bytes("lazy_recompile")
边栏推荐
- Fix the problem that the AI video intelligent platform easycvr device video cannot be played
- 【LINGO】求解二次规划
- 运维面临挑战?智能运维管理系统来帮您
- Understanding of Turing test and Chinese Room
- buildroot override 机制
- iNFTnews | 从《雪崩》到百度“希壤”,元宇宙30年的16件大事
- 在券商账户上买基金安全吗
- ctfshow-web354(SSRF)
- Record an online interface slow query problem troubleshooting
- Système de gestion de l'exploitation et de l'entretien, expérience d'exploitation humanisée
猜你喜欢

Will Internet talents be scarce in the future? Which technology directions are popular?
![[matlab] solve nonlinear programming](/img/2e/7a1f520b602b7539be479efb198f6a.png)
[matlab] solve nonlinear programming

AI视频智能平台EasyCVR设备录像出现无法播放现象的问题修复

Code practice - build your own diffusion models / score based generic models from scratch

8 figures | analyze Eureka's first synchronization registry

How to use Alibaba vector font files through CDN

LeetCode+ 71 - 75

【剑指offer&牛客101】中那些高频笔试,面试题——链表篇

Using fuseki query when there are multiple models in TDB

JSP - 分页
随机推荐
[recommendation technology] matlab simulation of network information recommendation technology based on collaborative filtering
rclone常用子命令中文解释
運維管理系統,人性化操作體驗
EasyNVS云管理平台功能重构:支持新增用户、修改信息等
Reply and explanation on issues related to "online training of network security education in 2022"
Pourquoi tant de gens sont - ils devenus des gestionnaires de produits? Quelles sont les perspectives de développement des gestionnaires de produits?
Solve the problem of "unexpected status code 503 service unavailable" when kaniko pushes the image to harbor
北漂程序员深夜emo发帖求助:女朋友走了我很孤独 ......
The programmer of Beipiao posted a post for help late at night: I am lonely when my girlfriend is gone
LeetCode+ 71 - 75
MySQL table partition creation method
【剑指offer&牛客101】中那些高频笔试,面试题——链表篇
ctfshow-web352,353(SSRF)
为什么这么多人转行产品经理?产品经理发展前景如何?
C# 读写自定义的Config文件
ctfshow-web352,353(SSRF)
C language implementation [Sanzi chess game] (step analysis and implementation source code)
(I) apple has open source, but so what?
ctfshow-web355,356(SSRF)
Why did grayscale fall from the altar?