Commit 6be636e1 by wl3b10s Committed by Tianqi Chen

image tranform runtime wrong on python (#354)

x = np.transpose(img, (2, 0, 1))[np.newaxis, :]
TypeError: an integer is required
parent 16c28d08
...@@ -54,8 +54,10 @@ from PIL import Image ...@@ -54,8 +54,10 @@ from PIL import Image
img_url = 'https://github.com/dmlc/mxnet.js/blob/master/data/cat.png?raw=true' img_url = 'https://github.com/dmlc/mxnet.js/blob/master/data/cat.png?raw=true'
download(img_url, 'cat.png') download(img_url, 'cat.png')
img = Image.open('cat.png').resize((224, 224)) img = Image.open('cat.png').resize((224, 224))
x = np.transpose(img, (2, 0, 1))[np.newaxis, :] #x = np.transpose(img, (2, 0, 1))[np.newaxis, :]
image = np.asarray(img)
image = image.transpose((2, 0, 1))
x = image[np.newaxis, :]
###################################################################### ######################################################################
# Compile the model on NNVM # Compile the model on NNVM
# --------------------------- # ---------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment