Closed prashant-puri closed 6 years ago
Hi @prashant-puri , the MXNet resnet model doesn't apply any preprocess method. You can remove the
transformer.set_mean('data', np.array([104, 117, 123]))
transformer.set_raw_scale('data', 255.0)
transformer.set_channel_swap('data', (2,1,0)) # Not sure about this one
and see if it works.
Hi @kitstar really appreciate your answer. I comment all three line as suggested. I works but result are still bad, Please check below result after removing code you suggested. input image is same as before image_name = 'http://farm4.static.flickr.com/3170/2533026039_a4d72913ec.jpg'
prob=0.999646782875 class=n04286575 spotlight, spot
prob=0.000113813846838 class=n04515003 upright, upright piano
prob=7.75204971433e-05 class=n03759954 microphone, mike
prob=5.58655337954e-05 class=n03666591 lighter, light, igniter, ignitor
prob=4.96878346894e-05 class=n03483316 hand blower, blow dryer, blow drier, hair dryer, hair drier
Hi @prashant-puri . Found the problem. Will fix soon and ping you asap. Thanks!
@kitstar Thanks..Wating for your reply :)
Hi @prashant-puri . Fixed. Please try the newest code again.
Ubuntu - 14.04
Python version: 2.7
Caffe : 1.0.0 (CPU)
MMDNN Path : http://data.dmlc.ml/mxnet/models/imagenet/resnet/18-layers/resnet-18-symbol.json http://data.dmlc.ml/mxnet/models/imagenet/resnet/18-layers/resnet-18-0000.params
I have successfully converted mxnet to caffe Model resnet-18.prototxt
Now I tried to predict the image using below script
Output:
prob=1.0 class=n03250847 drumstick prob=0.0 class=n15075141 toilet tissue, toilet paper, bathroom tissue prob=0.0 class=n02317335 starfish, sea star prob=0.0 class=n02389026 sorrel prob=0.0 class=n02364673 guinea pig, Cavia cobaya
Here I am getting drumstick label with probabiliyt 1.0.
Please Help