Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Problem in acc metric#7995

Merged
piiswrong merged 2 commits intoapache:masterfrom
solin319:solin-patch-metric
Sep 27, 2017
Merged

Problem in acc metric#7995
piiswrong merged 2 commits intoapache:masterfrom
solin319:solin-patch-metric

Conversation

@solin319
Copy link
Copy Markdown
Contributor

@solin319 solin319 commented Sep 22, 2017

In #7561, label and pred_label were convert to int32 in NDArray. This may slowdown the speed in train.
I use "train_imagenet.py" in example to train some models in 4 gpus in single machine., the batch-size is 128. The speed was shown as below.

                   convert in NDArray (samples/sec)             change to numpy first (samples/sec)
vgg16                      124                                             144
resnet-50                  183                                             185
resnet152                  77.8                                            78.3
inception-v3               116                                             117

@piiswrong piiswrong merged commit f65da2c into apache:master Sep 27, 2017
@mli
Copy link
Copy Markdown
Contributor

mli commented Oct 3, 2017

can we just use ndarray to compute instead of converting to numpy? if there is a number of classes, say 10K, then it could be problematic

a sample code:

def accuracy(output, label):
    # both output and label are ndarray
    return (output.argmax(axis=1)==label).sum().asscalar()

@solin319 solin319 deleted the solin-patch-metric branch October 7, 2017 13:56
crazy-cat pushed a commit to crazy-cat/incubator-mxnet that referenced this pull request Oct 26, 2017
@piiswrong piiswrong mentioned this pull request Jan 29, 2018
7 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants