Spaces:
Running
Running
Commit
·
6fa72c7
1
Parent(s):
9e80388
Remove post-training TensorBoard log charts
Browse files
app.py
CHANGED
@@ -257,23 +257,5 @@ def main():
|
|
257 |
# Wait a moment to ensure logs are written
|
258 |
time.sleep(1)
|
259 |
|
260 |
-
logdir = "logs"
|
261 |
-
if os.path.exists(logdir) and os.listdir(logdir):
|
262 |
-
ea = event_accumulator.EventAccumulator(logdir)
|
263 |
-
ea.Reload()
|
264 |
-
scalars = ea.Tags()['scalars']
|
265 |
-
for tag in ['loss', 'val_loss', 'accuracy']:
|
266 |
-
if tag in scalars:
|
267 |
-
values = [s.value for s in ea.Scalars(tag)]
|
268 |
-
st.line_chart({tag: values})
|
269 |
-
# Show confusion matrix images if available
|
270 |
-
if 'confusion_matrix' in ea.Tags()['images']:
|
271 |
-
st.subheader("TensorBoard Confusion Matrix (Last Epoch)")
|
272 |
-
imgs = ea.Images('confusion_matrix')
|
273 |
-
if imgs:
|
274 |
-
st.image(imgs[-1].encoded_image_string)
|
275 |
-
else:
|
276 |
-
st.info("No TensorBoard logs found. Please upload logs to the 'logs' directory.")
|
277 |
-
|
278 |
if __name__ == "__main__":
|
279 |
main()
|
|
|
257 |
# Wait a moment to ensure logs are written
|
258 |
time.sleep(1)
|
259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
260 |
if __name__ == "__main__":
|
261 |
main()
|