Jupyter gives LSTM algo result, then it gives out Keras.Modules errors with SAME code

Viewed 101

I am using Anaconda and Python 3.8 and have Tensorflow 2.5 and Keras 2.4.3 and I am getting this error below but only sometimes when running the EXACT SAME LSTM algo in Jupyter:

AttributeError                            
Traceback (most recent call 

AttributeError: module 'keras.utils.generic_utils' has no attribute ‘populate_dict_with_module_objects'

I’ve read on here the suggestions and tried a few Mac Terminal pip instructions to get the versions to reconcile but what I don’t understand is why using the SAME LSTM algo, it works sometimes and other times it produces the error code above.

Has anyone ever come across this issue before?

1 Answers

Try to solve the above error "AttributeError: module 'keras.utils.generic_utils' has no attribute ‘populate_dict_with_module_objects'"

By installing TensorFlow & Keras upgrading versions. It should solve your problem.

  • To upgrade TensorFlow version
!pip install tensorflow --upgrade --user
  • To upgrade Keras version
!pip install keras --upgrade --user
Related