What version of Keras are you using?
If you still do use Keras 2.3.1, please do ensure that your are not mixing keras
and tensorflow
versions.
More precisely, avoid using imports like from keras.layers
import Conv2D
and from tensorflow.keras.layers
import MaxPool2D
.
If the problem still persists after this issue, please use all the imports from tensorflow
, i.e. from tensorflow.keras import ....
.
Avoid using the plain Keras package, as it will become obsolete in the foreseeable future; the additional problem is that is nowhere near as well maintained as keras inside tensorflow.
You can uninstall it altogether from your environment.