ゼロから作るDeep Learning の3章3.6.1について
MINIST画像を表示させようとして以下のエラーメッセージが発生しました。
初心者なもので、ネットで調べて「モジュール名が・・」と書かれていたので
色々試行錯誤したのですが一向にわかりません。
発生している問題・エラーメッセージ
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 2, in img_show AttributeError: module 'numpy' has no attribute 'unit8'
該当のソースコード
import sys, os sys.path.append(os.pardir) import numpy as np from dataset.mnist import load_mnist from PIL import Image def img_show(img): pil_img = Image.fromarray(np.unit8(img)) pil_img.show() (x_train, t_train), (x_test, t_test) = \ load_mnist(flatten=True, normalize=False) print(x_train.shape) img = x_train[0] label = t_train[0] print(label) print(img.shape) img = img.reshape(28, 28) print(img.shape) img_show(img)
試したこと
実行フォルダとその上のフォルダ内のnumpyというファイル名のファイルを探したのですが見つからない
補足情報(FW/ツールのバージョンなど)
よくわからなくて助けてください・・・
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/03 15:43
2019/02/03 15:44
2020/09/03 05:47