naseemap47 / FaceRecognition-MTCNN-ArcFace

FaceRecognition with MTCNN using ArcFace
MIT License
10 stars 3 forks source link

AttributeError: 'KerasHistory' object has no attribute 'layer' #13

Open h-azad opened 1 month ago

h-azad commented 1 month ago

I'm having the following error when trying to execute the train.py

Traceback (most recent call last): File "/Volumes/Dev/Python/FaceRecognition-MTCNN-ArcFace/train.py", line 35, in <module> model = ArcFace.loadModel() ^^^^^^^^^^^^^^^^^^^ File "/Volumes/Dev/Python/FaceRecognition-MTCNN-ArcFace/ArcFace.py", line 17, in loadModel base_model = ResNet34() ^^^^^^^^^^ File "/Volumes/Dev/Python/FaceRecognition-MTCNN-ArcFace/ArcFace.py", line 49, in ResNet34 model = training.Model(img_input, x, name='ResNet34') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Volumes/Dev/Python/FaceRecognition-MTCNN-ArcFace/.venv/lib/python3.12/site-packages/tensorflow/python/trackable/base.py", line 204, in _method_wrapper result = method(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Volumes/Dev/Python/FaceRecognition-MTCNN-ArcFace/.venv/lib/python3.12/site-packages/tensorflow/python/keras/engine/functional.py", line 116, in __init__ self._init_graph_network(inputs, outputs) File "/Volumes/Dev/Python/FaceRecognition-MTCNN-ArcFace/.venv/lib/python3.12/site-packages/tensorflow/python/trackable/base.py", line 204, in _method_wrapper result = method(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Volumes/Dev/Python/FaceRecognition-MTCNN-ArcFace/.venv/lib/python3.12/site-packages/tensorflow/python/keras/engine/functional.py", line 152, in _init_graph_network self._validate_graph_inputs_and_outputs() File "/Volumes/Dev/Python/FaceRecognition-MTCNN-ArcFace/.venv/lib/python3.12/site-packages/tensorflow/python/keras/engine/functional.py", line 694, in _validate_graph_inputs_and_outputs layer = x._keras_history.layer ^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'KerasHistory' object has no attribute 'layer'

naseemap47 commented 1 month ago

Hi @h-azad , which version of keras is using ?