From f12e2972582516139ef25f0104ea00cbe5394ba8 Mon Sep 17 00:00:00 2001 From: huangyhg <2308942120@qq.com> Date: Wed, 23 Dec 2020 11:30:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=20If=20savemodel=20is=20none,=20do=20not?= =?UTF-8?q?=20restore=20it.=202.=20Change=20the=20two=20names=20to=20?= =?UTF-8?q?=E7=BC=BA=E5=B8=BD=E5=AD=90=20and=20=E7=BC=BA=E8=BA=AB=E4=BD=93?= =?UTF-8?q?=20=EF=BC=88match=20the=20author's=20paper=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FinalVer/capsule_inspection.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/FinalVer/capsule_inspection.py b/FinalVer/capsule_inspection.py index 143bfb5..53c5382 100644 --- a/FinalVer/capsule_inspection.py +++ b/FinalVer/capsule_inspection.py @@ -198,7 +198,8 @@ def train(opech, is_continnue_train=False): if is_continnue_train: # 装载checkpoint savemodel = tf.train.latest_checkpoint('./model/') - saver.restore(sess, savemodel) + if not savemodel is None: + saver.restore(sess, savemodel) for i in range(opech): str_ing = 'lr=' + str(learning_rate) + '迭代=' + str(opech) @@ -340,9 +341,9 @@ def tes_part(imagedir): elif maxindex == 1: return '凹陷' elif maxindex == 2: - return '帽子' + return '缺帽子' elif maxindex == 3: - return '身体' + return '缺身体' # 摄像头拍照并预测 def video_test(): @@ -390,7 +391,7 @@ def video_test(): train(400, is_continnue_train=True) -# 文件夹所有内容测试 +#文件夹所有内容测试 # for root, dirs, files in os.walk('D:/Image/test/'): # for filename in files: # filepath = os.path.join(root, filename) # 获取文件地址 From a85a6b0453bba4080919243988838dd8a220c424 Mon Sep 17 00:00:00 2001 From: huangyhg <2308942120@qq.com> Date: Wed, 23 Dec 2020 11:32:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=20If=20savemodel=20is=20none,=20do=20not?= =?UTF-8?q?=20restore=20it.=202.=20Change=20the=20two=20names=20to=20?= =?UTF-8?q?=E7=BC=BA=E5=B8=BD=E5=AD=90=20and=20=E7=BC=BA=E8=BA=AB=E4=BD=93?= =?UTF-8?q?=20=EF=BC=88match=20the=20author's=20paper=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FinalVer/capsule_inspection.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/FinalVer/capsule_inspection.py b/FinalVer/capsule_inspection.py index 143bfb5..53c5382 100644 --- a/FinalVer/capsule_inspection.py +++ b/FinalVer/capsule_inspection.py @@ -198,7 +198,8 @@ def train(opech, is_continnue_train=False): if is_continnue_train: # 装载checkpoint savemodel = tf.train.latest_checkpoint('./model/') - saver.restore(sess, savemodel) + if not savemodel is None: + saver.restore(sess, savemodel) for i in range(opech): str_ing = 'lr=' + str(learning_rate) + '迭代=' + str(opech) @@ -340,9 +341,9 @@ def tes_part(imagedir): elif maxindex == 1: return '凹陷' elif maxindex == 2: - return '帽子' + return '缺帽子' elif maxindex == 3: - return '身体' + return '缺身体' # 摄像头拍照并预测 def video_test(): @@ -390,7 +391,7 @@ def video_test(): train(400, is_continnue_train=True) -# 文件夹所有内容测试 +#文件夹所有内容测试 # for root, dirs, files in os.walk('D:/Image/test/'): # for filename in files: # filepath = os.path.join(root, filename) # 获取文件地址