用tensorflow实现自编码机的时候,关于batch的选择,一直报错:
ValueError: could not broadcast input array from shape (100,784) into shape (100)
定位代码:
可以看到是因为选取数据集时出了问题batch_test_x = mnist.train.next_batch(batch_size)
在训练的时候,需要选择合适batch的数据集训练,有两种正确的选取方法:
方法一:使用mnist.train.next_batch(batch_size)
在使用mnist.train.next_batch(batch_size)方法选择batch的时候,一定要注意正确的代码是:b