【发布时间】:2021-09-27 21:28:04
【问题描述】:
我只想执行 8 个类别分类,因此需要从 10 个类别中过滤掉任何 8 个类别。请帮忙。谢谢!
加载 cifar 10 的代码如下
#Keras library for CIFAR-10 dataset
from keras.datasets import cifar10
#Downloading the CIFAR dataset
(x_train,y_train),(x_test,y_test)=cifar10.load_data()
# I tried the following but its changing the array shape please help
#Train
for i in range(8):
index = np.where(y_train == i)
X_train = x_train[index]
Y_train = y_train[index]
#Test
for i in range(8):
index = np.where(y_test == i)
X_test = x_test[index]
Y_test = y_test[index]
【问题讨论】:
-
如何加载它?添加一些您到目前为止尝试过的相关代码。
-
我已经使用load_data方法加载了cifar 10
-
这能回答你的问题吗? Choosing only specific classes of CIFAR-10
标签: python tensorflow keras computer-vision