apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.77k stars 6.8k forks source link

One bug in mxnet1.6.0 gluon hybridize #18966

Closed zybsu27f22 closed 4 years ago

zybsu27f22 commented 4 years ago

Description

gluon nd接口与sym接口运算结果不一致的问题:如果在使用gluon定义的网络 中输出的结果有加上常数的时候模型hybridize后计算结果会出现错误。

To Reproduce

比如在gluoncv 中yolov3模型将YOLOOutputV3中box_centers = F.broadcast_add(F.sigmoid(raw_box_centers), offsets) self._stride 改为 box_centers = F.broadcast_add(F.tanh(raw_box_centers)3 +1 , offsets) * self._stride,模型在hybridize后与nd计算结果不同。如果单独测试tanh(x) + 1 sym接口与nd计算结果一致,该问题只在定义好的gluon多层网络模型中存在单层网络中没法复现。

What have you tried to solve it?

问题可能在模型hybridize过程中

github-actions[bot] commented 4 years ago

Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue. Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly. If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on contributing to MXNet and our development guides wiki.

szha commented 4 years ago

cc @zhreshold to help on GluonCV issues.

zhreshold commented 4 years ago

change box_centers = F.broadcast_add(F.tanh(raw_box_centers)*3 +1 , offsets) * self._stride to

box_centers = F.broadcast_add(F.broadcast_add(F.tanh(raw_box_centers)*3, 1) , offsets) * self._stride