From 3710c464d5b623b28c9cdad9b8a38c3dc1ad9525 Mon Sep 17 00:00:00 2001 From: Guy Jacob <guy.jacob@intel.com> Date: Sat, 5 Oct 2019 23:11:13 +0300 Subject: [PATCH] Fix exception type being caught in checkpoint load sanity check --- distiller/apputils/checkpoint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distiller/apputils/checkpoint.py b/distiller/apputils/checkpoint.py index d317bde..2757cd8 100755 --- a/distiller/apputils/checkpoint.py +++ b/distiller/apputils/checkpoint.py @@ -178,7 +178,7 @@ def load_checkpoint(model, chkpt_file, optimizer=None, try: if model.arch != checkpoint["arch"]: raise ValueError("The model architecture does not match the checkpoint architecture") - except (NameError, KeyError): + except (AttributeError, KeyError): # One of the values is missing so we can't perform the comparison pass -- GitLab