本文介绍了Jupyter 给出 LSTM 算法结果,然后用相同的代码给出 Keras.Modules 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Anaconda 和 Python 3.8 并且有 Tensorflow 2.5 和 Keras 2.4.3,我在下面收到此错误,但仅在有时在 Jupyter 中运行完全相同的 LSTM 算法时才出现:

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'

我在这里阅读了建议,并尝试了一些 Mac Terminal pip 指令来使版本协调,但我不明白为什么使用 SAME LSTM 算法,它有时会起作用,有时会产生错误上面的代码.

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?

推荐答案

尝试解决上述错误"AttributeError: module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'"

通过安装 TensorFlow &Keras 升级版本.它应该可以解决您的问题.

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

  • 升级 TensorFlow 版本
!pip install tensorflow --upgrade --user

  • 升级 Keras 版本
  • !pip install keras --upgrade --user
    

    这篇关于Jupyter 给出 LSTM 算法结果,然后用相同的代码给出 Keras.Modules 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 10:14