Closed ZaccurLi closed 3 years ago
https://github.com/MegEngine/Documentation/blob/main/source/getting-started/beginner/from-linear-regression-to-linear-classification.ipynb
1. Issue
plt_idx = i * num_classes + y + 1 plt.subplot(samples_per_class, num_classes, plt_idx) --->plt.imshow(train_data[idx], cmap="gray") plt.axis('off') # ... TypeError: Invalid shape (28, 28, 1) for image data
Solution
plt.imshow(train_data[idx].squeeze(), cmap="gray")
2. Issue
idx = 28204 # 可以修改这个值 plt.title("The label is: %s" % train_label[idx]) --->plt.imshow(train_data[idx], cmap="gray") plt.show() # ... TypeError: Invalid shape (28, 28, 1) for image data
3. Issue
plt.subplot(121) plt.axis('off') plt.title("Original Image:") --->plt.imshow(original_image, cmap="gray") # ... TypeError: Invalid shape (3, 3, 1) for image data
plt.imshow(original_image.squeeze(), cmap="gray")
感谢反馈,我们会在今天晚些时候更新。
Document
https://github.com/MegEngine/Documentation/blob/main/source/getting-started/beginner/from-linear-regression-to-linear-classification.ipynb
Environment:
Issue&Solution
1. Issue
Solution
2. Issue
Solution
3. Issue
Solution