2017-07-19 34 views
1

我是tensorflow的新手,瞭解基本知識我正在學習一個教程。當複製此代碼(https://github.com/random-forests/tutorials/blob/master/ep7.ipynb)並嘗試執行它時,我收到錯誤。張量流中的classifier.predict錯誤(shape_and_slice spec中的shape不匹配)

W¯¯tensorflow /核心/框架/ op_kernel.cc:993]無效參數:形狀在規格shape_and_slice [1,10]不匹配存儲在檢查點的形狀:[784,10] 回溯(最近最後調用):...

這似乎是負責的命令是follwing:

classifier.predict(test_data[0]) 

你能告訴我這個問題?

回答

5

請嘗試

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

這對我來說

工作
相關問題