Hi everyone,
I have trained cats vs dogs model on fastai GPU instance on aws and then when i tried to use the model on my machine (mac OS) to predict an image class predict_array doesn’t seem to work due to this error Torch not compiled with CUDA enabled
img = cv2.imread('dog.jpg')
_, img_encoded = cv2.imencode('.jpg', img)
nparr = np.fromstring(img_encoded.tostring(), np.uint8)
flags = cv2.IMREAD_UNCHANGED+cv2.IMREAD_ANYDEPTH+cv2.IMREAD_ANYCOLOR
image = cv2.cvtColor(cv2.imdecode(nparr, flags).astype(np.float32) / 255, cv2.COLOR_BGR2RGB)
image = val_tfms(image)
preds = learn.predict_array(image[None])
Does anyone know how to solve this in able to run prediction on cpu ?