2023-01-05 13:23:58 +01:00
|
|
|
import os
|
|
|
|
|
|
|
|
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
|
|
|
|
import matplotlib.pyplot as plt
|
|
|
|
|
|
|
|
from tensorboard.backend.event_processing import event_accumulator
|
|
|
|
import numpy as np
|
|
|
|
import json
|
|
|
|
from jsmin import jsmin
|
|
|
|
import glob
|
|
|
|
|
|
|
|
# -------------------------------
|
|
|
|
|
|
|
|
filename:str = "def.json"
|
|
|
|
with open(filename) as json_file:
|
|
|
|
minified = jsmin(json_file.read())
|
|
|
|
data = json.loads(minified)
|
2023-01-15 03:02:07 +01:00
|
|
|
|
2023-01-05 13:23:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
# -------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
path_runs: str = "./Log/*"
|
|
|
|
|
|
|
|
temp = glob.glob(path_runs)
|
|
|
|
assert len(temp) == 1
|
|
|
|
path = temp[0]
|
|
|
|
|
|
|
|
|
|
|
|
acc = event_accumulator.EventAccumulator(path)
|
|
|
|
acc.Reload()
|
|
|
|
|
|
|
|
available_scalar = acc.Tags()["scalars"]
|
|
|
|
available_histograms = acc.Tags()["histograms"]
|
|
|
|
|
|
|
|
which_scalar = "Test Error"
|
|
|
|
te = acc.Scalars(which_scalar)
|
|
|
|
|
|
|
|
temp = []
|
|
|
|
for te_item in te:
|
|
|
|
temp.append((te_item[1], te_item[2]))
|
|
|
|
temp = np.array(temp)
|
|
|
|
|
|
|
|
print(temp)
|
2023-01-13 21:31:12 +01:00
|
|
|
np.save(f"test_error.npy", temp)
|
2023-01-05 13:23:58 +01:00
|
|
|
|