我正在构建的卷积网络不断出现错误,但我不知道为什么会出现错误。这是我的网络:
learning_rate = 0.0001
epochs = 10
batch_size = 128
test_valid_size = 128
n_classes = 5
dropout = 0.75
start1 = timer()
with tf.device('/gpu:0'):
weights = {
'wc1': tf.Variable(tf.random_normal([5, 5, 1, 32])),
'wc2': tf.Variable(tf.random_normal([5, 5, 32, 64])),
'wd1': tf.Variable(tf.random_normal([7*7*64, 1024])),
'out': tf.Variable(tf.random_normal([1024, n_classes]))}
biases = {
'bc1': tf.Variable(tf.random_normal([32])),
'bc2': tf.Variable(tf.random_normal([64])),
'bd1': tf.Variable(tf.random_normal([1024])),
'out': tf.Variable(tf.random_normal([n_classes]))}
x = tf.placeholder(tf.float32, [None, 80, 240, 1])
y = tf.placeholder(tf.float32, [None, n_classes])
keep_prob = tf.placeholder(tf.float32)
layer_1 = tf.nn.conv2d(x, weights['wc1'], strides = [1, 1, 1, 1], padding …Run Code Online (Sandbox Code Playgroud)