微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么重塑对我的火车数据有效,但对测试数据无效?

如何解决为什么重塑对我的火车数据有效,但对测试数据无效?

在这里,我正在使用Fahion-mnist数据集。它已经分为测试和培训。我希望每个img都是28x28x3形状。

X_train shape:  (60000,784)

X_test shape:  (10000,784)

# Reshaping
X_train = X_train.values.reshape(-1,28,3) 

print("X_train shape: ",X_train.shape) 

**output:** (20000,3)

可以,但是可以!!

X_test = X_test.values.reshape(-1,3)
print("X_test shape: ",X_test.shape)

ValueError                                Traceback (most recent call last)
<ipython-input-110-9f1d9f52d152> in <module>()
1 X_test = X_test.values.reshape(-1,3)
2 print("X_test shape: ",X_test.shape)

 **ValueError: cannot reshape array of size 7840000 into shape (28,3)**

请帮助我

我正在遵循此操作,但是我已删除了“灰度”部分。 https://www.kaggle.com/orhansertkaya/convolutional-neural-network-cnn-fashion-mnist

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。