的错误分类器。预测在tensorflow中(Shape\u slice spec中的形状不匹配)

2024-06-06 05:11:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我是tensorflow的新手,为了理解基础知识,我正在学习教程。当复制这个代码(https://github.com/random-forests/tutorials/blob/master/ep7.ipynb)并试图执行它时,我得到了一个错误。在

W tensorflow/core/framework/op_kernel.cc:993] Invalid argument: Shape in shape_and_slice spec [1,10] does not match the shape stored in checkpoint: [784,10] Traceback (most recent call last):...

似乎应该负责的命令如下:

 classifier.predict(test_data[0])

你能告诉我问题出在哪里吗?在


Tags: 代码inhttpsgithubmastercomtensorflow教程
2条回答

请尝试一下

classifier.predict(np.array([test_data[0]], dtype=float), as_iterable=False)

对我有用

旁注:您必须增加raspberry pi上的内存才能运行示例(并添加表演()在显示功能中)

从这个网站学到的 https://qiita.com/mgr206/items/9fc0de88ff9547372cac 不需要日语,只需检查命令即可

相关问题 更多 >