From c156d6241b4a646d641c2a4378f2cbd7d3218711 Mon Sep 17 00:00:00 2001 From: Johnson yue Date: Thu, 27 Feb 2020 14:13:42 +0800 Subject: [PATCH] add makedirs functions --- mnist_cINN/eval.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mnist_cINN/eval.py b/mnist_cINN/eval.py index ff842ed..0d53ab7 100644 --- a/mnist_cINN/eval.py +++ b/mnist_cINN/eval.py @@ -4,7 +4,7 @@ from sklearn.decomposition import PCA import matplotlib.pyplot as plt -import torch +import torch, os from tqdm import tqdm from torch.nn.functional import avg_pool2d, interpolate @@ -299,6 +299,7 @@ def temperature(temp=None, rows=10, columns=24, save_as=None): for s in tqdm(range(0, 256)): torch.manual_seed(s) + os.makedirs('./images/samples', exist_ok=True) temperature(0.88, columns=1, save_as='./images/samples/T_%.4i.png' % (s)) plt.title(str(s))