fer icon indicating copy to clipboard operation
fer copied to clipboard

'Model' object has no attribute 'make_predict_function'

Open linguist89 opened this issue 2 years ago • 10 comments

I getting this error: 'Model' object has no attribute 'make_predict_function' and I took a look at the fer.py file in the repo. Line 117 has the following code self.__emotion_classifier.make_predict_function() but it doesn't seem like there is a make_predict_function() anywhere so I think that is causing the problem. Anyone else run into the same problem?

linguist89 avatar Mar 26 '22 22:03 linguist89

Which version FER are you using, what command did you run?

On Sat, Mar 26, 2022 at 11:39 PM linguist89 @.***> wrote:

I getting this error: 'Model' object has no attribute 'make_predict_function' and I took a look at the fer.py file in the repo. Line 117 has the following code self.__emotion_classifier.make_predict_function() but it doesn't seem like there is a make_predict_function() anywhere so I think that is causing the problem. Anyone else run into the same problem?

— Reply to this email directly, view it on GitHub https://github.com/justinshenk/fer/issues/42, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOLMZE3RTRQHA2EDRC5HLDVB6GZXANCNFSM5RXY56ZQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

JustinShenk avatar Mar 26 '22 23:03 JustinShenk

I installed via "pip install -U fer" so it should be the latest version This is the command I'm running in my Python script

img = cv2.imread("test.jpeg") detector = FER() detector.detect_emotions(img)

linguist89 avatar Mar 27 '22 08:03 linguist89

Can you show the outputs of pip list?

JustinShenk avatar Mar 28 '22 09:03 JustinShenk

Package Version


absl-py 1.0.0 anvil-uplink 0.3.42 astor 0.8.1 certifi 2021.10.8 charset-normalizer 2.0.12 cycler 0.11.0 fer 21.0.6 fonttools 4.31.2 future 0.18.2 gast 0.2.2 google-pasta 0.2.0 grpcio 1.44.0 h5py 2.10.0 idna 3.3 importlib-metadata 4.11.3 keras 2.8.0 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.2 kiwisolver 1.4.1 Markdown 3.3.6 matplotlib 3.5.1 mtcnn 0.1.1 numpy 1.21.5 opencv-contrib-python 4.5.5.64 opencv-python 4.5.5.64 opt-einsum 3.3.0 packaging 21.3 pandas 1.3.5 Pillow 9.0.1 pip 21.2.4 protobuf 3.19.4 pyparsing 3.0.7 python-dateutil 2.8.2 pytz 2022.1 requests 2.27.1 setuptools 57.5.0 six 1.16.0 tensorboard 1.15.0 tensorflow 1.15.2 tensorflow-estimator 1.15.1 termcolor 1.1.0 tqdm 4.63.1 typing_extensions 4.1.1 urllib3 1.26.9 Werkzeug 2.0.3 wheel 0.37.1 wrapt 1.14.0 ws4py 0.5.1 zipp 3.7.0

linguist89 avatar Mar 28 '22 11:03 linguist89

I'm running it on a Docker container, so I'm not sure if that could be a problem.

linguist89 avatar Mar 30 '22 19:03 linguist89

The FER version there is 21.0.6. Maybe update the FER, the latest version is 22.4.0.

On Wed, Mar 30, 2022 at 9:41 PM linguist89 @.***> wrote:

I'm running it on a Docker container, so I'm not sure if that could be a problem.

— Reply to this email directly, view it on GitHub https://github.com/justinshenk/fer/issues/42#issuecomment-1083551576, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOLMZAN7HEKY3WRI6KI6C3VCSU6RANCNFSM5RXY56ZQ . You are receiving this because you commented.Message ID: @.***>

JustinShenk avatar Mar 31 '22 09:03 JustinShenk

I've updated now to 22.4.0 and the Docker container is running fine, but it still gives me the error: 'Model' object has no attribute 'make_predict_function'

linguist89 avatar Mar 31 '22 10:03 linguist89

Can you share a minimal reproducible example? I can't reproduce this on my side.

On Thu, Mar 31, 2022 at 12:01 PM linguist89 @.***> wrote:

I've updated now to 22.4.0 and the Docker container is running fine, but it still gives me the error: 'Model' object has no attribute 'make_predict_function'

— Reply to this email directly, view it on GitHub https://github.com/justinshenk/fer/issues/42#issuecomment-1084357101, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOLMZHX3RRWY3DXKU3RSETVCVZWLANCNFSM5RXY56ZQ . You are receiving this because you commented.Message ID: @.***>

JustinShenk avatar Apr 03 '22 12:04 JustinShenk

it seems that the tensorflow.python.keras.engine.training.Model object has deprecated the "make_predict_function()" into "_make_predict_function()" (at least with tensorflow > 1.15.0)

nicolas-gaude avatar Apr 05 '22 16:04 nicolas-gaude

It seems to be rather the opposite, _make_predict_function is deprecated: https://www.tensorflow.org/api_docs/python/tf/keras/Model - thus your tensorflow version is somehow older. If you can share a minimal example I can look closer at it.

On Tue, Apr 5, 2022 at 6:22 PM nicolas gaude @.***> wrote:

it seems that the tensorflow.python.keras.engine.training.Model object has no deprecated the "make_predict_function()" into "_make_predict_function()" (at least with tensorflow > 1.15.0)

— Reply to this email directly, view it on GitHub https://github.com/justinshenk/fer/issues/42#issuecomment-1088969038, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOLMZHHNTQMGXDSOKONCU3VDRSEPANCNFSM5RXY56ZQ . You are receiving this because you commented.Message ID: @.***>

JustinShenk avatar Apr 06 '22 10:04 JustinShenk