Skip to content

Commit 7a367af

Browse files
author
whyboris
committed
tensorboard works
1 parent a0e0a82 commit 7a367af

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ __pycache__
44
output
55
venv
66
*.h5
7+
logs

notes.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ pip install -r requirements.txt
1111
jupyter notebook
1212

1313
jupyter lab
14+
15+
tensorboard --logdir=logs
16+
http://localhost:6006/
17+

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ matplotlib
66
numpy==1.13.0
77
opencv-python
88
pylint
9-
tensorflow
9+
tensorflow
10+
# html5lib newer version needed to get tensorboard to work
11+
html5lib==1.0.1

tensorboard.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@
2525

2626
model.summary()
2727

28-
model.compile(optimiser='rmsprop', loss='binary_crossentropy', metrics=['acc'])
28+
model.compile(optimizer='rmsprop', loss='binary_crossentropy', metrics=['acc'])
29+
30+
callbacks = [
31+
keras.callbacks.TensorBoard(
32+
log_dir = './logs',
33+
histogram_freq=1,
34+
embeddings_freq=1,
35+
)
36+
]
37+
38+
history = model.fit(x_train, y_train,
39+
epochs=20,
40+
batch_size=128,
41+
validation_split=0.2,
42+
callbacks=callbacks)
43+
2944

3045

0 commit comments

Comments
 (0)