From 22d3efd9642ae33559bbec3f222ad391352c921d Mon Sep 17 00:00:00 2001 From: Nadim Kawwa <40652202+NadimKawwa@users.noreply.github.com> Date: Wed, 2 Jan 2019 10:26:45 +0200 Subject: [PATCH] Error in numpy method image.numpy().transpose((1, 2, 0)) does not seem to be a valid method. it throws the following error: AttributeError: 'numpy.ndarray' object has no attribute 'numpy' I suggest just removing the numpy() method and it works fine. --- Image Classifier Project.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Image Classifier Project.ipynb b/Image Classifier Project.ipynb index eec7a117..ed1df87e 100644 --- a/Image Classifier Project.ipynb +++ b/Image Classifier Project.ipynb @@ -231,7 +231,7 @@ " \n", " # PyTorch tensors assume the color channel is the first dimension\n", " # but matplotlib assumes is the third dimension\n", - " image = image.numpy().transpose((1, 2, 0))\n", + " image = image.transpose((1, 2, 0))\n", " \n", " # Undo preprocessing\n", " mean = np.array([0.485, 0.456, 0.406])\n",