diff --git a/eval_model.py b/eval_model.py index fef402f..f83f923 100644 --- a/eval_model.py +++ b/eval_model.py @@ -31,11 +31,9 @@ def main(): loss_fn = torch.nn.MSELoss() loss = test(dataloader, model, loss_fn) - with open('evaluation_results.txt', 'r+') as f: - f.read() + with open('evaluation_results.txt', 'a+') as f: f.write(f'{str(loss)}\n') - f.flush() - f.seek(0) + with open('evaluation_results.txt', 'r') as f: values = [float(line) for line in f.readlines() if line] make_plot(values)