From c7cfde39953a7a4adfa3f71771d8ce4d8ac60c94 Mon Sep 17 00:00:00 2001 From: "Weiguang (Gavin) Ding" Date: Mon, 15 May 2017 19:17:59 -0400 Subject: [PATCH 1/2] remove extra 8 classes from inception model --- inception_score/model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/inception_score/model.py b/inception_score/model.py index bf69254..8cdfd4d 100644 --- a/inception_score/model.py +++ b/inception_score/model.py @@ -41,6 +41,7 @@ def get_inception_score(images, splits=10): inp = inps[(i * bs):min((i + 1) * bs, len(inps))] inp = np.concatenate(inp, 0) pred = sess.run(softmax, {'ExpandDims:0': inp}) + pred = pred[:1000] # remove extra 8 classes from inception model preds.append(pred) preds = np.concatenate(preds, 0) scores = [] From ab9e6249fca305edd7c7aea121382a790cdd5b36 Mon Sep 17 00:00:00 2001 From: "Weiguang (Gavin) Ding" Date: Mon, 15 May 2017 20:24:33 -0400 Subject: [PATCH 2/2] Update model.py --- inception_score/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inception_score/model.py b/inception_score/model.py index 8cdfd4d..cb9a642 100644 --- a/inception_score/model.py +++ b/inception_score/model.py @@ -41,7 +41,8 @@ def get_inception_score(images, splits=10): inp = inps[(i * bs):min((i + 1) * bs, len(inps))] inp = np.concatenate(inp, 0) pred = sess.run(softmax, {'ExpandDims:0': inp}) - pred = pred[:1000] # remove extra 8 classes from inception model + # remove extra 8 classes from inception model + pred = pred[:, :1000] preds.append(pred) preds = np.concatenate(preds, 0) scores = []