【发布时间】:2020-04-19 08:21:52
【问题描述】:
我看到一个使用Fruit360 dataset 的项目并尝试运行代码。我已导入所有库,但在编译代码时出错。你能帮我解决这个问题吗?
代码:
Test_label_ids = np.array([label_to_id_dict[x] for x in Test_labels])
错误信息:
KeyError Traceback (most recent call last)
<ipython-input-15-c5a5039c5bdd> in <module>
----> 1 Test_label_ids = np.array([label_to_id_dict[x] for x in Test_labels])
<ipython-input-15-c5a5039c5bdd> in <listcomp>(.0)
----> 1 Test_label_ids = np.array([label_to_id_dict[x] for x in Test_labels])
KeyError: 'C:\\Users\\Msi\\Desktop\\KaggleDataset\\fruits-360_dataset\\fruits-360\\Test\\Apple Braeburn'
【问题讨论】:
-
Test_labels的内容是什么?
标签: python neural-network jupyter-notebook conv-neural-network