ModuleNotFoundError: No module named 'keras'

The imports from the unit 4 exercise 4.1 import modules directly from keras. By that I mean they do keras.<module_name>, should it be tensorflow.keras.<module_name> instead? It works if I do so.

Specifically I am referring to:

/home/user/catkin_ws/src/dlrepo/dl_exercises/unit4/model.py
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
from keras.layers import Dropout
from keras.regularizers import l2
/home/user/catkin_ws/src/dlrepo/dl_exercises/unit4/predict.py
from keras.models import load_model

Hello @GasPatxo ,

Yes, that is correct. The other option is to install keras with pip3 install keras, but you can also use the tensorflow version. I’ll update the notebook to reflect this.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.