name | about | labels |
---|---|---|
Bug Report | Use this template for reporting a bug | kind/bug |
cpu及npu静态图模式下,网络采用value_and_grad以及trainonestepcell训练时loss可以正常计算,但是梯度均一直为0,且不优化。
Ascend
/GPU
/CPU
) / 硬件环境:Please delete the backend not involved / 请删除不涉及的后端:
/device ascend/GPU/CPU/kirin/等其他芯片
Software Environment / 软件环境 (Mandatory / 必填):
-- MindSpore version (e.g., 1.7.0.Bxxx) :2.2.1
-- Python version (e.g., Python 3.7.5) :3.7.16
-- OS platform and distribution (e.g., Linux Ubuntu 16.04):Linux Ubuntu
-- GCC/Compiler version (if compiled from source):
Excute Mode / 执行模式 (Mandatory / 必填)(PyNative
/Graph
):
Please delete the mode not involved / 请删除不涉及的模式:
/mode pynative
代码仓:https://gitee.com/kaiqixu/att2in
可以计算梯度,且正常优化。
Please assign maintainer to check this issue.
请为此issue分配处理人。
@fangwenyi @chengxiaoli @Shawny
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
感谢您的提问,您可以评论//mindspore-assistant更快获取帮助:
您好,我已经根据网站内容进行调试,所有参数属性均正常,训练参数的requires_grad均等于True,初始化也没有问题,但是所有参数的梯度仍然为0。
建议通过官网教程排查代码:https://www.mindspore.cn/docs/zh-CN/r2.3.0rc1/migration_guide/model_development/gradient.html
或者通过其他官网网络参考写法:https://gitee.com/mindspore/models/tree/master/official
如您发现有疑似bug,可以简化网络后通过unit test或demo方式在评论提交代码,我们会进一步排查
登录 后才可以发表评论