From ba2f4deb170cb0a6fe8cec61213a0da61fd9a6e5 Mon Sep 17 00:00:00 2001
From: tomrink <rink@ssec.wisc.edu>
Date: Wed, 3 Aug 2022 12:56:55 -0500
Subject: [PATCH] fix resize use problem

---
 modules/deeplearning/espcn.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/modules/deeplearning/espcn.py b/modules/deeplearning/espcn.py
index 91297c91..a09007e1 100644
--- a/modules/deeplearning/espcn.py
+++ b/modules/deeplearning/espcn.py
@@ -242,9 +242,6 @@ class ESPCN:
 
         # data = np.concatenate(data_s)
         data = np.concatenate(label_s)
-        hr_shape = data.shape
-        data = tf.image.resize(data, (hr_shape[0], hr_shape[1], hr_shape[2] // 2, hr_shape[3] // 2))
-
         label = np.concatenate(label_s)
 
         label = label[:, label_idx, :, :]
@@ -252,6 +249,7 @@ class ESPCN:
 
         data = data[:, data_idx, :, :]
         data = np.expand_dims(data, axis=3)
+        data = tf.image.resize(data, (32, 32)).numpy()
 
         data = data.astype(np.float32)
         label = label.astype(np.float32)
-- 
GitLab