Gunner Stone
Gunner Stone

Reputation: 1005

Tensorboard only producing epoch logs, not train/val

Im trying to produce plots of my training loss / validation loss over each epoch. Ideally it would look something like the following.

enter image description here

Lots of tutorials that are able to produce graphs like the above use x_train and y_train as inputs to the model.fit along with a validation_split=0.3. It would look something like this:

tensorboard = TensorBoard(log_dir='logs/')

history= model.fit(x_train,y_train,batch_size=n,epochs=epochs,validation_split=0.3,callbacks=[tensorboard])

My project uses ImageDataGenerator to produce variations of training/validation/test data and automatically label it.

My line of training my model looks like the following:

history = model.fit(train_generator,epochs=epochs,validation_data=validation_generator,callbacks=[tensorboard])

My tensorboard only produces the following (which isnt helpful)

enter image description here

If someone could let me know what Im missing or if its even possible, that would be helpful. Im using tensorflow 2.3.0 and tensorboard 2.4.1 if that helps.

Upvotes: 0

Views: 770

Answers (1)

Gunner Stone
Gunner Stone

Reputation: 1005

When using tensorboard with generators, your tensorboard callback will produce a folder that has both training and validation logs. You can see both listed on the left here:

enter image description here

For lots of logs, you can easily filter out only validation by utilizing the regex. Just type 'val' and you will only get validation results.

enter image description here

Upvotes: 1

Related Questions