現在、『ゼロから作るDeep Learning』でDeep Learningの学習を行っています。以下のプログラムについてです。
python3
1os.chdir("/home/pi/download/deep-learning-from-scratch-master/ch03") 2import sys, os 3import os 4sys.path.append(os.pardir) 5import numpy as np 6from dataset.mnist import load_mnist 7from PIL import Image 8 9def img_show(img): 10 pil_img = Image.fromarray(np.uint8(img)) 11 pil_img.show() 12 13 14(x_train, t_train), (x_test, t_test) = \ 15 load_mnist(flatten=True, normalize=False) 16 17 18img = x_train[0] 19label = t_train[0] 20print(label) 21print(img.shape) 22img = img.reshape(28,28) 23print(img.shape) 24img_show(img) 25コード
最後のimg_show(img)を入力しても、画像が出力されません。また、エラー表記も出ません。何が原因なのか教えていただけると助かります。
あなたの回答
tips
プレビュー