ageron / ageron/handson-ml

Chapter 13 Question 7 Code

未關閉
#566 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Jupyter Notebook
星號
25.6k
分支
12.7k
PR 合併指標
30 天內沒有已合併 PR

描述

The code provided to produce a CNN seems to error out. I am able to run all of the code up to the very last block.

```
with tf.Session() as sess:
init.run()
for epoch in range(n_epochs):
for X_batch, y_batch in shuffle_batch(X_train, y_train, batch_size):
sess.run(training_op, feed_dict={X: X_batch, y: y_batch})
acc_batch = accuracy.eval(feed_dict={X: X_batch, y: y_batch})
acc_test = accuracy.eval(feed_dict={X: X_test, y: y_test})
print(epoch, "Last batch accuracy:", acc_batch, "Test accuracy:", acc_test)

save_path = saver.save(sess, "./my_mnist_model")
```
Which produces the following error.

`ValueError: Cannot feed value of shape (100, 784) for Tensor 'inputs/X:0', which has shape '(?, 1960)'`

Has anyone else encountered this or knowledgeable about what could be going on?

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。