[MXNET-171] Fix a bug that was causing training accuracy to be printed as nan sometimes (#10437)
[MXNET-171] Fix a bug that was causing training accuracy to be printed as nan sometimes (#10437)

* Fix a bug that was causing training accuracy to be printed as nan sometimes.

* Avoid the additional 'arg_eval_metric' variable. There should be no
overhead except for the batch in an epoch.

* Fix lint.

* For the last batch, Capture metrics before callback and use it to print epoch metrics

* Remove unused import

navrasio/mxnet,indhub/mxnet,szha/mxnet,yajiedesign/mxnet,tlby/mxnet,zhreshold/mxnet,mbaijal/incubator-mxnet,luoyetx/mxnet,fullfanta/mxnet,reminisce/mxnet,apache/incubator-mxnet,fullfanta/mxnet,larroy/mxnet,mbaijal/incubator-mxnet,luoyetx/mxnet,jamesliu/mxnet,yajiedesign/mxnet,larroy/mxnet,ptrendx/mxnet,tlby/mxnet,TuSimple/mxnet,larroy/mxnet,yajiedesign/mxnet,leezu/mxnet,sxjscience/mxnet,fullfanta/mxnet,precedenceguo/mxnet,dmlc/mxnet,apache/incubator-mxnet,fullfanta/mxnet,sxjscience/mxnet,reminisce/mxnet,zhreshold/mxnet,ForkedReposBak/mxnet,TuSimple/mxnet,DickJC123/mxnet,luoyetx/mxnet,zhreshold/mxnet,ptrendx/mxnet,sxjscience/mxnet,tlby/mxnet,sxjscience/mxnet,ForkedReposBak/mxnet,rahul003/mxnet,mbaijal/incubator-mxnet,navrasio/mxnet,navrasio/mxnet,precedenceguo/mxnet,sxjscience/mxnet,jamesliu/mxnet,reminisce/mxnet,indhub/mxnet,tlby/mxnet,DickJC123/mxnet,szha/mxnet,ForkedReposBak/mxnet,navrasio/mxnet,TuSimple/mxnet,yajiedesign/mxnet,fullfanta/mxnet,reminisce/mxnet,yajiedesign/mxnet,DickJC123/mxnet,sxjscience/mxnet,szha/mxnet,luoyetx/mxnet,navrasio/mxnet,indhub/mxnet,ForkedReposBak/mxnet,reminisce/mxnet,tlby/mxnet,precedenceguo/mxnet,ForkedReposBak/mxnet,yajiedesign/mxnet,rahul003/mxnet,precedenceguo/mxnet,fullfanta/mxnet,dmlc/mxnet,jamesliu/mxnet,rahul003/mxnet,jamesliu/mxnet,larroy/mxnet,leezu/mxnet,tlby/mxnet,ForkedReposBak/mxnet,sxjscience/mxnet,mbaijal/incubator-mxnet,szha/mxnet,larroy/mxnet,reminisce/mxnet,larroy/mxnet,ptrendx/mxnet,luoyetx/mxnet,ptrendx/mxnet,leezu/mxnet,navrasio/mxnet,mbaijal/incubator-mxnet,TuSimple/mxnet,ForkedReposBak/mxnet,rahul003/mxnet,larroy/mxnet,jamesliu/mxnet,ForkedReposBak/mxnet,reminisce/mxnet,TuSimple/mxnet,szha/mxnet,indhub/mxnet,TuSimple/mxnet,ptrendx/mxnet,fullfanta/mxnet,dmlc/mxnet,precedenceguo/mxnet,navrasio/mxnet,leezu/mxnet,zhreshold/mxnet,yajiedesign/mxnet,dmlc/mxnet,leezu/mxnet,leezu/mxnet,ptrendx/mxnet,indhub/mxnet,DickJC123/mxnet,szha/mxnet,eric-haibin-lin/mxnet,fullfanta/mxnet,leezu/mxnet,jamesliu/mxnet,eric-haibin-lin/mxnet,rahul003/mxnet,TuSimple/mxnet,dmlc/mxnet,mbaijal/incubator-mxnet,dmlc/mxnet,luoyetx/mxnet,rahul003/mxnet,ForkedReposBak/mxnet,mbaijal/incubator-mxnet,reminisce/mxnet,rahul003/mxnet,yajiedesign/mxnet,zhreshold/mxnet,eric-haibin-lin/mxnet,zhreshold/mxnet,rahul003/mxnet,TuSimple/mxnet,tlby/mxnet,yajiedesign/mxnet,navrasio/mxnet,tlby/mxnet,apache/incubator-mxnet,eric-haibin-lin/mxnet,apache/incubator-mxnet,reminisce/mxnet,leezu/mxnet,sxjscience/mxnet,fullfanta/mxnet,mbaijal/incubator-mxnet,szha/mxnet,luoyetx/mxnet,navrasio/mxnet,zhreshold/mxnet,szha/mxnet,jamesliu/mxnet,ptrendx/mxnet,leezu/mxnet,jamesliu/mxnet,jamesliu/mxnet,indhub/mxnet,ptrendx/mxnet,rahul003/mxnet,mbaijal/incubator-mxnet,luoyetx/mxnet,indhub/mxnet,ptrendx/mxnet,precedenceguo/mxnet,reminisce/mxnet,zhreshold/mxnet,eric-haibin-lin/mxnet,sxjscience/mxnet,szha/mxnet,indhub/mxnet,TuSimple/mxnet,eric-haibin-lin/mxnet,eric-haibin-lin/mxnet,eric-haibin-lin/mxnet,precedenceguo/mxnet,ptrendx/mxnet,precedenceguo/mxnet,tlby/mxnet,larroy/mxnet,eric-haibin-lin/mxnet,precedenceguo/mxnet,zhreshold/mxnet,larroy/mxnet,dmlc/mxnet,tlby/mxnet,dmlc/mxnet,indhub/mxnet,luoyetx/mxnet,dmlc/mxnet,TuSimple/mxnet