简体   繁体   中英

Tensorboard only showing two scalars with all the data

So I am using Tensorboard and it shows all the data together (validation loss and normal etc.) which is SUPER messy and I can't work with it.

import tensorflow as tf 
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense,Dropout,Activation, Flatten, Conv2D, MaxPooling2D, Reshape
from tensorflow.keras.callbacks import TensorBoard
import time
import pickle 
import numpy as np
from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession




config = ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)


#tensorboard = TensorBoard(log_dir='logs/{}'.format(NAME))

pickle_in = open("X.pickle","rb")
X = pickle.load(pickle_in)

pickle_in = open("y.pickle","rb")
y = pickle.load(pickle_in)

X=np.array(X/255.0)
y=np.array(y)

dense_layers = [0,1,2]
layer_sizes = [32,64,128]
conv_layers = [1,2,3]
for dense_layer in dense_layers:
    for layer_size in layer_sizes:
        for conv_layer in conv_layers:
            NAME = "{}-conv-{}-nodes-{}-dense-{}".format(conv_layer,layer_size,dense_layer, int(time.time()))
            file_writer = tf.train.SummaryWriter('/logs/{}.format(NAME)', sess.graph)
            print(NAME)
            model = Sequential()
            model.add(Reshape((100,100,1)))
            model.add(Conv2D(64, (3,3), input_shape = X.shape[1:]))
            model.add(Activation("relu"))
            model.add(MaxPooling2D(pool_size=(2,2)))

            for l in range(conv_layer-1):
                model.add(Conv2D(64, (3,3)))
                model.add(Activation("relu"))
                model.add(MaxPooling2D(pool_size=(2,2)))
            
            model.add(Flatten())
            for l in range(dense_layer):
                model.add(Dense(layer_size))
                model.add(Activation("relu"))
            
            # model.add(Dense(64))
            # model.add(Activation("relu"))
            
            model.add(Dense(1))
            model.add(Activation("sigmoid"))

            model.compile(loss="binary_crossentropy",
                         optimizer="adam",
                         metrics=["accuracy"])

            model.fit(X,y, batch_size=5,epochs=10, validation_split=0.1, callbacks=[file_writer])

Can anyone help? I don't get what I am doing wrong or if this is normal. Because I have seen multiple tutorials where there were scalars for everything. Thanks in Advance!!!!

this may not be a direct answer to your question, but have you tried Aim ?

It's easy to get started and is very straightforward to integrate/use. Aim's main superpower is that you can compare lots of experiments at once.

import aim
aim.set_params(hyperparam_dict, name='hparams')
aim.track(metric_value, name='metric_name', epoch=epoch_number)

Disclaimer: I am a contributor.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM