当前位置:网站首页>在华为昇腾Ascend910上复现swin_transformer
在华为昇腾Ascend910上复现swin_transformer
2022-07-25 16:44:00 【花花少年】
一、运行环境
硬件平台
[ma-user swin_transformer]$export -p
declare -x AICPU_FLAG="1"
declare -x ANACONDA_DIR="/home/ma-user/anaconda3"
declare -x ASCEND_AICPU_PATH="/usr/local/Ascend/nnae/latest/"
declare -x ASCEND_HOME="/usr/local/Ascend"
declare -x ASCEND_OPP_PATH="/usr/local/Ascend/nnae/latest/opp"
declare -x CONDA3_DIR="/opt/conda/bin"
declare -x CONDA_DIR="/opt/conda"
declare -x CPU_LIMIT="24.0"
declare -x CREDENTIAL_PROFILES_FILE="/etc/secret-volume/credentials"
declare -x FWK_PYTHON_PATH="/usr/local/Ascend/nnae/latest/fwkacllib/python/site-packages"
declare -x GATEWAY_IMAGE_ID=""
declare -x HOME="/home/ma-user"
declare -x JUPYTER_SERVER_ROOT="/home/ma-user/work"
declare -x LD_LIBRARY_PATH="/usr/lib/aarch64-linux-gnu/hdf5/serial:/usr/local/Ascend/nnae/latest/fwkacllib/lib64:/usr/local/Ascend/driver/lib64/common/:/usr/local/Ascend/driver/lib64/driver:/usr/lib64"
declare -x LESSOPEN="||/usr/bin/lesspipe.sh %s"
declare -x LINES="40"
declare -x LOGNAME="ma-user"
declare -x ME_TBE_PLUGIN_PATH="/usr/local/Ascend/opp/framework/built-in/tensorflow/"
declare -x MINICONDA_DIR="/opt/conda"
declare -x MODELARTS_SDK_VERSION="1.1.5"
declare -x MS_BUILD_PROCESS_NUM="20"
declare -x MindsporeEnv="MindSpore"
declare -x NOTEBOOK_IMAGE_NAME="notebook2.0-mul-kernel-arm-ascend-cp37"
declare -x NOTEBOOK_IMAGE_VERSION="3.3.3-c79-20220121"
declare -x OLDPWD="/home/ma-user"
declare -x OPTION_EXEC_EXTERN_PLUGIN_PATH="/usr/local/Ascend/fwkacllib/lib64/plugin/opskernel/libfe.so:/usr/local/Ascend/fwkacllib/lib64/plugin/opskernel/libaicpu_plugin.so:/usr/local/Ascend/fwkacllib/lib64/plugin/opskernel/librts_engine.so:/usr/local/Ascend/fwkacllib/lib64/plugin/opskernel/libge_local_engine.so"
declare -x PATH="/home/ma-user/.local/bin:/home/ma-user/bin:/usr/local/Ascend/nnae/latest/fwkacllib/ccec_compiler/bin:/usr/local/Ascend/nnae/latest/fwkacllib/bin:/home/ma-user/anaconda3/envs/MindSpore/bin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/ma-user/modelarts/ma-cli/bin"
declare -x PWD="/home/ma-user/work/swin_transformer"
declare -x PYTHONPATH="/usr/local/Ascend/nnae/latest/fwkacllib/python/site-packages:/usr/local/Ascend/nnae/latest/fwkacllib/python/site-packages/auto_tune.egg:/usr/local/Ascend/nnae/latest/fwkacllib/python/site-packages/schedule_search.egg:/usr/local/Ascend/tfplugin/latest/tfplugin/python/site-packages:/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe"
declare -x RANK_TABLE_FILE="/user/config/nbstart_hccl.json"
declare -x REGION_NAME="cn-central-231"
declare -x SHELL="/bin/bash"
declare -x SOC_VERSION="Ascend910A"
declare -x TBE_IMPL_PATH="/usr/local/Ascend/nnae/latest/opp/op_impl/built-in/ai_core/tbe"
declare -x TERM="xterm"
declare -x TF_PLUGIN_PKG="/usr/local/Ascend/tfplugin/latest/tfplugin/python/site-packages"
declare -x TensorflowEnv="TensorFlow-1.15.0"
declare -x USER="ma-user"
declare -x USERNAME="ma-user"
declare -x XDG_CACHE_HOME="/home/ma-user/.cache"
二、相关介绍
2.1 相关教程
2.2 错误码查询
2.3 Atlas硬件产品兼容性查询
三、关键步骤
ModelZoo:Swin-Transformer
博主的代码:https://gitee.com/lljyoyo1995/swin_transformer
3.1 资源占用情况
CPU占用情况
资源占用情况
NPU占用情况
NPU功率
四、FAQ
Q:MindSpore版本不一致导致API接口错误
[ERROR] MD(67033,fffea5ffb1e0,python):2022-07-20-17:51:48.714.669 [mindspore/ccsrc/minddata/dataset/util/task.cc:67] operator()] Task: MapOp(ID:3) - thread(281469171773920) is terminated with err msg: Unexpected error. map operation: [Decode] failed. Decode: invalid input shape, only support 1D input, got rank: 3
Line of code : 42
File : /home/jenkins/agent-working-dir/workspace/[email protected]/mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/decode_op.cc
self.saved_output_shapes = runtime_getter[0].GetOutputShapes()
RuntimeError: Unexpected error. map operation: [Decode] failed. Decode: invalid input shape, only support 1D input, got rank: 3
Line of code : 42
File : /home/jenkins/agent-working-dir/workspace/[email protected]/mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/decode_op.cc
错误原因:
MindSpore版本更新之后,部分接口
解决办法:
1. 修改导包方式
import mindspore.dataset.vision as vision
改为
import mindspore.dataset.vision.c_transforms as vision
import mindspore.dataset.vision.py_transforms as pvision
2. 修改ToPIL()接口
vision.ToPIL()
改为
pvision.ToPIL()
# 注释掉Decode()
# vision.Decode()
[ERROR] MD(71480,fffe5f7fe1e0,python):2022-07-20-18:01:47.677.517 [mindspore/ccsrc/minddata/dataset/util/task.cc:67] operator()] Task: MapOp(ID:3) - thread(281467988992480) is terminated with err msg: Unexpected error. map operation: [Normalize] failed. Normalize: number of channels does not match the size of mean and std vectors, got channels: 224, size of mean:3
Line of code : 810
File : /home/jenkins/agent-working-dir/workspace/[email protected]/mindspore/mindspore/ccsrc/minddata/dataset/kernels/image/image_utils.cc
错误原因:
Normalize()接口错误
MindSpore版本更新较快,新旧接口不一致导致源代码无法运行
解决办法:
1. 修改导包方式
import mindspore.dataset.transforms as C
import mindspore.dataset.vision as vision
改为
import mindspore.dataset.transforms.c_transforms as C
import mindspore.dataset.vision.c_transforms as vision
import mindspore.dataset.vision.py_transforms as pvision
2. 修改Normalize()接口
vision.Normalize(mean=mean, std=std)
改为
pvision.Normalize(mean=mean, std=std)
边栏推荐
- 3D semantic segmentation - scribed supervised lidar semantic segmentation
- How does win11's own drawing software display the ruler?
- [OBS] Reprint: what about the serious delay of OBS live broadcast and Caton?
- 邮件的收发的展现逻辑之收件箱发件箱以及回复断链的问题
- [xiao5 chat] check the official account < the service provided by the official account has failed, please wait a moment>
- 测试框架-unittest-测试套件、结果输出到文件
- 【目标检测】YOLOv5跑通VisDrone数据集
- 城市燃气安全再拉警钟,如何防患于未“燃”?
- After 20 years of agitation, the chip production capacity has started from zero to surpass that of the United States, which is another great achievement made in China
- 【obs】转载:OBS直播严重延迟和卡顿怎么办?
猜你喜欢

7.依赖注入

3D semantic segmentation - scribed supervised lidar semantic segmentation

搜狗批量推送软件-搜狗批量推送工具【2022最新】

【小5聊】公众号排查<该公众号提供的服务出现故障,请稍后>

如何安装govendor并打开项目

复旦大学EMBA同学同行专题:始终将消费者的价值放在最重要的位置
![[zeloengine] summary of pit filling of reflection system](/img/7a/c85ba66c5dd05908b2d784fab306a2.png)
[zeloengine] summary of pit filling of reflection system

失意的互联网人拼命叩开Web3大门

Fudan University emba2022 graduation season - graduation does not forget the original intention and glory to embark on the journey again

How does win11's own drawing software display the ruler?
随机推荐
华泰vip账户证券开户安全吗
Test framework unittest command line operation and assertion method
7.依赖注入
【云驻共创】探秘GaussDB如何助力工商银行打造金融核心数据
[book club issue 13] +ffmpeg video capture function
What is the monthly salary of 10000 in China? The answer reveals the cruel truth of income
链游开发现成版 链游系统开发详细原理 链游源码交付
Attachment handling of SAP Fiori
C#入门基础教程
IaaS基础架构云 —— 云网络
气数已尽!运营 23 年,昔日“国内第一大电商网站”黄了。。。
[cloud co creation] explore how gaussdb helps ICBC create core financial data
Emqx cloud update: more parameters are added to log analysis, which makes monitoring, operation and maintenance easier
MySQL linked table query, common functions, aggregate functions
【MySQL篇】一文带你初识数据库
0x80131500 solution for not opening Microsoft Store
【ZeloEngine】反射系统填坑小结
Today, I went to oppo for an interview and was asked numbly
Use huggingface to quickly load pre training models and datasets in moment pool cloud
Unity is better to use the hot scheme Wolong