0
$\begingroup$

I am trying to predict on my test set and I get the following error

AttributeError: 'Functional' object has no attribute 'uses_learning_phase'

The model is created from the Class Model imported from from keras.engine import Module All the module I imported are from tensorflow.keras except for the package mentioned above. I also tried Importing everything from Keras alone but I still get the same error !

I have tensroflow 2.0 and keras 2.4.3

$\endgroup$
0
$\begingroup$

Could you please share some snippets of your code where the error arises? Generally attribute errors are caused when documentations are updated and that specific attribute is no longer present for the version! Importing new libraries (which you have tried already) or lowering the library version can help but for a definitive answer the code snippet is required!

P.S Sorry for posting this as an answer, I can't comment yet haha.

$\endgroup$
2
  • $\begingroup$ So sorry I actually solved it. this attribute exists on Keras 2.3.0 and I was using Keras 2.4.0. Anyway Thanks for the help! I'll accept this as an answer $\endgroup$ – Hamza Hamdani Aug 27 '20 at 17:45
  • $\begingroup$ No problem! Im glad its solved! Thank you very much ! $\endgroup$ – Soumya Kundu Aug 27 '20 at 22:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.