oarriaga / paz

Hierarchical perception library in Python for pose estimation, object detection, instance segmentation, keypoint estimation, face recognition, etc.
https://oarriaga.github.io/paz/
MIT License
626 stars 103 forks source link

Issue with loading model in MiniXception #341

Open Y-Srivaishnavi opened 1 month ago

Y-Srivaishnavi commented 1 month ago

I tried to test the MiniXceptionFER emotion classifier on a single image.

The Code:

emo_detect = MiniXceptionFER()
X_test, y_test = load_images_from_directory("data\\test")
image = cv2.cvtColor(X_test[0], cv2.COLOR_GRAY2RGB)
emo_detect(image)

This is the error it raised:

C:\Users\Uname\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\optimizers\base_optimizer.py:34: UserWarning: Argument `decay` is no longer supported and will be ignored.
  warnings.warn(
Traceback (most recent call last):
  File "c:\Users\Uname\file_path\file_name.py", line 38, in <module>
    emo_detect = MiniXceptionFER()
                 ^^^^^^^^^^^^^^^^^
  File "C:\Users\Uname\AppData\Roaming\Python\Python311\site-packages\paz\pipelines\classification.py", line 38, in __init__  
    self.classifier = MiniXception((48, 48, 1), 7, weights='FER')
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Uname\AppData\Roaming\Python\Python311\site-packages\paz\models\classification\xception.py", line 106, in MiniXception
    model = load_model(path)
            ^^^^^^^^^^^^^^^^
. . .

  File "C:\Users\2003y\AppData\Local\Programs\Python\Python311\Lib\site-packages\keras\src\optimizers\base_optimizer.py", line 38, in __init__
    raise ValueError(f"Argument(s) not recognized: {kwargs}")
ValueError: Argument(s) not recognized: {'lr': 1.0000000656873453e-05}

I checked the source code and model = load_model(path) isn't a part of xception.py. I've installed pypaz only yesterday, so I shouldn't have to upgrade it either. Am I missing something?