Skip to content

Commit 26cffc0

Browse files
authored
Merge pull request #49 from JulesBelveze/fix/memory-overflow
[tsa/eval] - fix: ensure matplotlib figures are closed after saving
2 parents b5bc494 + 4cb8c0c commit 26cffc0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tsa/eval.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def evaluate(test_iter, criterion, model, config, ts):
5050
plt.plot(preds, linewidth=.3)
5151
plt.plot(targets, linewidth=.3)
5252
plt.savefig("{}/preds.png".format(config.general.output_dir))
53+
plt.close()
5354

5455
torch.save(targets, os.path.join(config.general.output_dir, "targets.pt"))
5556
torch.save(predictions, os.path.join(config.general.output_dir, "predictions.pt"))

0 commit comments

Comments
 (0)