Closed VisanXJ closed 7 years ago
the exception already told you the reason Cannot feed value of shape (1, 32, 32, 1) for Tensor 'x_:0', which has shape '(13, 32, 32, 1)
you should set batch_size=13
in fit
sorry! but the lastest debug ouputs says "Start training the network ..." but no any other info
sorry, I have a question about how can i use fit function when I use CNN. I loaded minist dataset as you did, but I don't know how to apply it. `X_train, y_train, X_val, y_val, X_test, y_test = load_dataset(dataset_dir = dataset_path, shape=(-1, 32, 32, 1)) sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True)) ... x_train_batch, y_train_batch = tf.train.shuffle_batch([X_train, y_train], batch_size=batch_size, capacity=2000, min_after_dequeue=1000, num_threads=2) x_test_batch, y_test_batch = tf.train.batch([X_test, y_test], batch_size=batch_size, capacity=50000, num_threads=2) ... x_crop = tf.placeholder(tf.float32, shape=[batchsize, 32, 32, 1], name='x') y_ = tf.placeholder(tf.int32, shape=[batchsize,], name='y') network, cost, acc = model(xcrop, y, None) ...
train the network
... `
I notice the debug otput is "Cannot feed value of shape (1, 32, 32, 1) for Tensor 'x_:0', which has shape '(13, 32, 32, 1)'" and batch_size=13
Any problem here? Thank you for your help