Tensorboard标量看起来像一团糟

时间:2018-01-23 02:20:03

标签: tensorflow deep-learning tensorboard

我使用TensorLayer为MNIST数据集构建了一个深层的宪法网络。我使用RMS优化器并具有衰减学习率。但是当使用tensorboard微调模型时,我在损失曲线中看到了这一点,我认为这是不正常的。任何人都可以帮忙吗?

Horizontal Axis: STEP Horizontal Axis: RELATIVE

有一个名为network的深度卷积网络,该网络使用以下代码进行训练

data = pd.read_csv('data/train.csv')
data_x = data.drop('label',1).values
data_y = data['label'].values

num = len(data.index)
trainset = np.random.choice(num, int(num * 0.9), replace=False)

train_X = data_x[trainset,:].astype(np.float32)
valid_X = np.delete(data_x, trainset, axis=0).astype(np.float32)
train_y = data_y[trainset]
valid_y = np.delete(data_y, trainset, axis=0)
test_X = pd.read_csv('data/test.csv').values

network = ...

y = network.outputs
y_op = tf.argmax(tf.nn.softmax(y), 1, name='y_op')
cost = tl.cost.cross_entropy(y, y_, name='conv_cost')
correct_prediction = tf.equal(tf.argmax(y, 1), y_)
acc = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))

global_step = tf.Variable(0, trainable=False)
lr = tf.train.exponential_decay(0.001, global_step, 2560, 0.16, staircase=True)
train_op = tf.train.RMSPropOptimizer(lr, 0.9, momentum=0.3, epsilon=1e-4).minimize(cost, var_list=network.all_params)
tl.layers.initialize_global_variables(sess)
tl.utils.fit(sess, network, train_op, cost, X_train=train_X, y_train=train_y, x=X, y_=y_, X_val=valid_X, y_val=valid_y,
             acc=acc, batch_size=256, n_epoch=80, print_freq=1, eval_train=False, tensorboard=True, tensorboard_epoch_freq=1)

1 个答案:

答案 0 :(得分:1)

行。它转变为事件文件的问题,所有这些都放在一个文件夹中。它可以通过删除所有其他事件文件并重新启动tensorboard来解决。