machine-perception-robotics-group / MPRGDeepLearningLectureNotebook

354 stars 34 forks source link

MNISTデータセットがダウンロードできないバグの修正 (CNN, MNIST編) #12

Closed KotaShimomura closed 5 months ago

KotaShimomura commented 5 months ago

概要

CNNによる画像認識(MNIST, Numpy実装)

上記のnotebookでMNISTがダウンロードできません. そのため,torchvisionのMNISTを利用する方法に変更しています.

変更点

x_train = train_data.data.numpy().reshape(-1, 784) y_train = train_data.targets.numpy() x_test = test_data.data.numpy().reshape(-1, 784) y_test = test_data.targets.numpy()

x_train = x_train.reshape(-1, 1, 28, 28) x_test = x_test.reshape(-1, 1, 28, 28)

print(x_train.shape, y_train.shape) print(x_test.shape, y_test.shape)