いちばんやさしいディープラーニング入門教室という書籍で下記のエラーがでました。
anacondaが原因でしょうか。
試したことはpip,pillowをアンインストールしたりしました。
プログラミング自体初心者なのでうまく質問もできていないかもしれないですがよろしくお願いいたします。
ImportError Traceback (most recent call last) <ipython-input-94-222d054ca290> in <module> 38 showimg(filename, "query", i+1) 39 plt.show() ---> 40 results = predict(filename, 10) 41 for result in results: 42 print(result) <ipython-input-94-222d054ca290> in predict(filename, featuresize) 16 # 画像判定のための関数 17 def predict(filename, featuresize): ---> 18 img = image.load_img(filename, target_size=(224, 224)) 19 x = image.img_to_array(img) 20 x = np.expand_dims(x, axis=0) /anaconda3/envs/tensorflow16/lib/python3.5/site-packages/keras_preprocessing/image/utils.py in load_img(path, grayscale, color_mode, target_size, interpolation) 106 color_mode = 'grayscale' 107 if pil_image is None: --> 108 raise ImportError('Could not import PIL.Image. ' 109 'The use of `load_img` requires PIL.') 110 img = pil_image.open(path) ImportError: Could not import PIL.Image. The use of `load_img` requires PIL.
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/27 00:15
2019/07/27 14:44
2019/07/27 14:54
2019/07/27 22:30