瀏覽代碼

fix 'local variable 'im' referenced before assignment' for classification transform

FlyingQianMM 4 年之前
父節點
當前提交
f573631ad8
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      paddlex/cv/transforms/cls_transforms.py

+ 1 - 0
paddlex/cv/transforms/cls_transforms.py

@@ -73,6 +73,7 @@ class Compose(ClsTransform):
                 raise Exception(
                     "im should be 3-dimension, but now is {}-dimensions".
                     format(len(im_file.shape)))
+            im = im_file
         else:
             try:
                 if input_channel == 3: