卷积神经网络中的"ValueError: Asked to retrieve element 0, but the Sequence has length 0"



我使用的是以下代码:https://github.com/gsurma/image_classifier/blob/master/ImageClassifierCNN.ipynb但是我得到这个错误:ValueError: Asked to retrieve element 0, but the Sequence has length 0在这行:probabilities = model.predict_generator(test_generator, TEST_SIZE)。我遵循了这个建议:如何通过测试生成器消除错误?我把上面的行改成了:probabilities = model.predict(test_generator, TEST_SIZE),但不起作用!这个:ValueError:要求检索元素0,但序列的长度为0,这对我的情况没有解决方案。知道怎么了吗?

经过搜索,我发现我需要在"测试";文件夹,其中文件夹名称是";猫;以及";狗";。为了看到所有的测试图像,我将CCD_;测试";文件夹

相关内容

最新更新