我在短时间内使用 Tensorflow。这是我的问题:我加载 AlexNet 权重以对其进行微调,所以我给出了 50 的批次。所以我定义了:
# Graph input
x = tf.placeholder(tf.float32, [50, 227, 227, 3])
y = tf.placeholder(tf.float32, [None, 40])
Run Code Online (Sandbox Code Playgroud)
我给出了一批 50 张图像,并希望获得 40 个输出类。
然后我定义了我的模型
class Model:
@staticmethod
def alexnet(_X, _dropout):
# Layer 1 (conv-relu-pool-lrn)
conv1 = conv(_X, 11, 11, 96, 4, 4, padding='VALID', name='conv1')
conv1 = max_pool(conv1, 3, 3, 2, 2, padding='VALID', name='pool1')
norm1 = lrn(conv1, 2, 2e-05, 0.75, name='norm1')
# Layer 2 (conv-relu-pool-lrn)
conv2 = conv(norm1, 5, 5, 256, 1, 1, group=2, name='conv2')
conv2 = max_pool(conv2, …Run Code Online (Sandbox Code Playgroud)