Python to_category和错误值error:zero size数组到没有标识的最大缩减操作

Python to_category和错误值error:zero size数组到没有标识的最大缩减操作,python,tensorflow,deep-learning,jupyter-notebook,conv-neural-network,Python,Tensorflow,Deep Learning,Jupyter Notebook,Conv Neural Network,我对jupyter笔记本上的这些代码行有问题: from keras.utils import to_categorical y_train_one_hot = to_categorical(y_train) y_test_one_hot = to_categorical(y_test) 我得到这个错误: ValueError:从零大小数组到无标识的最大缩减操作 我正在测试的代码来自这里: 我使用的数据集是来自kaggle的dog vs cat数据集,不推荐共享外部链接。您能否在此处共享独立代

我对jupyter笔记本上的这些代码行有问题:

from keras.utils import to_categorical
y_train_one_hot = to_categorical(y_train)
y_test_one_hot = to_categorical(y_test)
我得到这个错误:

ValueError:从零大小数组到无标识的最大缩减操作

我正在测试的代码来自这里:
我使用的数据集是来自kaggle的dog vs cat数据集,不推荐共享外部链接。您能否在此处共享独立代码和数据以复制您的问题?这样我们可以试着帮助你。谢谢