You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/07 22:21:36 UTC
[GitHub] jwfromm commented on issue #8978: Very Low Accuracy When Using Pretrained Model
jwfromm commented on issue #8978: Very Low Accuracy When Using Pretrained Model
URL: https://github.com/apache/incubator-mxnet/issues/8978#issuecomment-350112503
The issue turned out to be that both scaling and normalization are needed to match the pytorch transforms.
```
def transformer(data, label):
data = mx.image.imresize(data, 256, 256)
data, _ = mx.image.center_crop(data, (224, 224))
data = data.astype(np.float32)
data = data/255
data = mx.image.color_normalize(data,
mean=mx.nd.array([0.485, 0.456, 0.406]),
std=mx.nd.array([0.229, 0.224, 0.225]))
data = mx.nd.transpose(data, (2,0,1))
return data, label
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services