From 64657c2c46f38ac3e87db8a342d3c2bfe7786f28 Mon Sep 17 00:00:00 2001 From: pilhoon Date: Sat, 17 Nov 2018 14:36:52 +0900 Subject: [PATCH] modify code for working in gpu context. (#13302) --- docs/tutorials/python/predict_image.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/tutorials/python/predict_image.md b/docs/tutorials/python/predict_image.md index a9a0d29010c1..8be98d991366 100644 --- a/docs/tutorials/python/predict_image.md +++ b/docs/tutorials/python/predict_image.md @@ -69,6 +69,7 @@ def get_image(url, show=False): img = mx.image.imresize(img, 224, 224) # resize img = img.transpose((2, 0, 1)) # Channel first img = img.expand_dims(axis=0) # batchify + img = img.astype('float32') # for gpu context return img def predict(url):