Browse Source

add AlexNet

jiangjiajun 5 years ago
parent
commit
8d24391383
1 changed files with 4 additions and 3 deletions
  1. 4 3
      paddlex/cv/models/load_model.py

+ 4 - 3
paddlex/cv/models/load_model.py

@@ -46,9 +46,10 @@ def load_model(model_dir, fixed_input_shape=None):
     if '_Attributes' in info:
         if 'fixed_input_shape' in info['_Attributes']:
             fixed_input_shape = info['_Attributes']['fixed_input_shape']
-            logging.info("Model already has fixed_input_shape with {}".format(
-                fixed_input_shape))
-            model.fixed_input_shape = fixed_input_shape
+            if fixed_input_shape is not None:
+                logging.info("Model already has fixed_input_shape with {}".
+                             format(fixed_input_shape))
+                model.fixed_input_shape = fixed_input_shape
 
     if status == "Normal" or \
             status == "Prune" or status == "fluid.save":