ModuleNotFoundError: No module named 'keras.api'

See original GitHub issue

Hi I tried to finetune my dataset but I couldn’t solve this problem.

My env:

Ubuntu 18.04

My virtual conda list :

cudatoolkit = 11.2.2 cudnn = 8.1.0.77
tensorflow = 2.6.0
keras = 2.6.0

when I run the code,

`Traceback (most recent call last): File “main.py”, line 24, in <module> import dataloader File “/home/ais/Liberty/automl/efficientdet/dataloader.py”, line 19, in <module> import utils File “/home/ais/Liberty/automl/efficientdet/utils.py”, line 167, in <module> class TpuBatchNormalization(tf.keras.layers.BatchNormalization): File “/home/ais/anaconda3/envs/peace/lib/python3.7/site-packages/tensorflow/python/util/lazy_loader.py”, line 62, in getattr module = self._load() File “/home/ais/anaconda3/envs/peace/lib/python3.7/site-packages/tensorflow/python/util/lazy_loader.py”, line 45, in _load module = importlib.import_module(self.name) File “/home/ais/anaconda3/envs/peace/lib/python3.7/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level)

`ModuleNotFoundError: No module named ‘keras.api’

I’ve got those error message. I really have no idea about ‘keras.api’ module. Could anyone please tell me what is wrong here??

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

4reactions
chang48commented, Sep 10, 2021

@ymodak Indeed, the problem is resolved after installing keras 2.6.0. Thanks

2reactions
katoyucommented, Aug 18, 2021

@YeonSeo-Kim Hi. I ran into the same error. I consider that this error is specific to the version 2.6.0. For the first aid, I downgraded the keras version from 2.6.0 to 2.4.0 and it worked fine. Please try it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'keras.api' error
However, I am getting an error message "ModuleNotFoundError: No module named 'keras.api'" as shown in the error log below.
Read more >
ModuleNotFoundError: No module named 'keras.api' #15262
I'm using Macbook Pro to run a server which was used to deploy on AWS. I have received an unknown error when running...
Read more >
ModuleNotFoundError: No module named 'keras'
It is because your TensorFlow module might be installed in an environment that is different from the environment where Keras is installed in....
Read more >
Fix the No module named keras error in Python
Learn how to troubleshoot the module not found error for the kears deep learning library on Jupyter, Pycharm and VSCode.
Read more >
error:No module named 'keras.api' - ttweixiao9999 - 博客园
前一个月还运行没问题的代码,今天在代码运行到“from keras.utils import np_utils, ... ModuleNotFoundError: No module named 'keras.api' 的错误。
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found