diff --git "a/AscendPytorch\346\250\241\345\236\213\344\274\227\346\231\272FAQ.md" "b/AscendPytorch\346\250\241\345\236\213\344\274\227\346\231\272FAQ.md" index fd18238dcca33ba0b3fbe063a3df6a8f60431fc6..1f18a7a0c2358fda4523aef4145866cc58b09180 100644 --- "a/AscendPytorch\346\250\241\345\236\213\344\274\227\346\231\272FAQ.md" +++ "b/AscendPytorch\346\250\241\345\236\213\344\274\227\346\231\272FAQ.md" @@ -909,9 +909,24 @@ print(stream.synchronize(),"point") - 处理方法 (1)可通过top指令查看是否有cpu使用率,如果有使用率,说明正在编译算子 -(2)通过ps -ef|grep python指令查看进程模型进程是否还在,还在的话说明程序正常运行中 -每个模型编译算子耗时时间都不一样,一般耗时会在几分钟内。 +(2)通过ps -ef|grep python指令查看模型进程是否还在,还在的话说明程序正常运行中 +每个模型编译算子耗时时间都不一样,一般耗时会在几分钟内。 +### FAQ45、模型训练过程DCNv2算子+混合精度报错:excepted scalar type float but found half +- 现象描述 +模型训练过程使用到DCNv2算子,混合精度配置为O2模式,训练过程报错 +![](https://gitee.com/zwx5317131/ascend-pytorch-crowdintelligence-doc/raw/master/figures/model_faq45_fig1_0719.PNG) + +- 原因分析 +DCNv2算子不支持混合精度O2模式 + +- 处理方法 +修改混合精度为O1模式,同时修改dcn_v2.py文件中DCNv2算子的前向传播和反向传播的入参类型为fp32。 +DCNv2安装版本以该链接为例:https://github.com/jinfagang/DCNv2_latest +对比源码,适配后的dcn_v2.py文件对比差异如下: +![](https://gitee.com/zwx5317131/ascend-pytorch-crowdintelligence-doc/raw/master/figures/model_faq45_fig2_0719.PNG) + + ## [2.2 NPU模型分布式运行常见问题FAQ](#22-NPU模型分布式运行常见问题FAQ) diff --git a/figures/model_faq45_fig1_0719.PNG b/figures/model_faq45_fig1_0719.PNG new file mode 100644 index 0000000000000000000000000000000000000000..e12297bf63cf8b8950f0d666bd59888527d0ab04 Binary files /dev/null and b/figures/model_faq45_fig1_0719.PNG differ diff --git a/figures/model_faq45_fig2_0719.PNG b/figures/model_faq45_fig2_0719.PNG new file mode 100644 index 0000000000000000000000000000000000000000..0b70bfa31a1729e617b2a02b5e030430f6ad4cba Binary files /dev/null and b/figures/model_faq45_fig2_0719.PNG differ