当前位置:网站首页>在华为昇腾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)
边栏推荐
- 如何安装govendor并打开项目
- C Music
- 基于SqlSugar的开发框架循序渐进介绍(13)-- 基于ElementPlus的上传组件进行封装,便于项目使用
- 柏睿数据加入阿里云PolarDB开源数据库社区
- [cloud co creation] explore how gaussdb helps ICBC create core financial data
- 【redis】redis安装
- Google Earth Engine——全球建筑物GlobalMLBuildingFootprints矢量集合下载
- C # simulation lottery
- 从数字化到智能运维:有哪些价值,又有哪些挑战?
- Is the win11 dynamic tile gone? Method of restoring dynamic tile in Win 11
猜你喜欢

【知识图谱】实践篇——基于医疗知识图谱的问答系统实践(Part4):结合问题分类的问题解析与检索语句生成

3D 语义分割——Scribble-Supervised LiDAR Semantic Segmentation

Is the win11 dynamic tile gone? Method of restoring dynamic tile in Win 11

Why 4everland is the best cloud computing platform for Web 3.0

【obs】转载:OBS直播严重延迟和卡顿怎么办?

为什么 4EVERLAND 是 Web 3.0 的最佳云计算平台

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

城市燃气安全再拉警钟,如何防患于未“燃”?

ReBudget:通过运行时重新分配预算的方法,在基于市场的多核资源分配中权衡效率与公平性

Use huggingface to quickly load pre training models and datasets in moment pool cloud
随机推荐
【读书会第13期】+FFmpeg开源项目
【知识图谱】实践篇——基于医疗知识图谱的问答系统实践(Part3):基于规则的问题分类
微信公众号开发之消息的自动回复
Fudan University EMBA peer topic: always put the value of consumers in the most important position
Differences between cookies, cookies and sessions
Verifiable random function VRF
China's chip self-sufficiency rate has increased significantly, resulting in high foreign chip inventories and heavy losses. American chips can be said to have thrown themselves in the foot
Understanding service governance in distributed development
Test framework unittest command line operation and assertion method
2W word detailed data Lake: concept, characteristics, architecture and cases
吴恩达逻辑回归2
如何使用 4EVERLAND CLI 在 IPFS 上部署应用程序
unity 最好用热更方案卧龙 wolong
fastadmin tp 安装使用百度富文本编辑器UEditor
Cookie、cookie与session区别
百度富文本编辑器UEditor 图片宽度100%自适应,手机端
Solve win10 disk occupation of 100%
3D semantic segmentation - PVD
百度富文本编辑器UEditor单张图片上传跨域
Baidu rich text editor ueeditor single image upload cross domain