0
votes
h5py
Keras==2.0.3
numpy
opencv-python
sklearn
tensorflow 2.0 > 

I'm getting the following error message

Using TensorFlow backend. 2020-04-02 01:53:58.259516: I
tensorflow/stream_executor/platform/default/dso_loader.cc:44]
Successfully opened dynamic library libcudart.so.10.1 Traceback (most
recent call last): File "train_frcnn.py", line 10, in
from keras import backend as K File "/usr/local/lib/python3.6/dist-
packages/keras/init.py", line 4, in

from . import applications File "/usr/local/lib/python3.6/dist-

packages/keras/applications/init.py", line 1, in from .vgg16 import VGG16 File "/usr/local/lib/python3.6/dist-
packages/keras/applications/vgg16.py",
line 14, in
from ..models import Model File "/usr/local/lib/python3.6/dist-
packages/keras/models.py", line 14, in from . import layers as layer_module File "/usr/local/lib/python3.6/dist-
packages/keras/layers/init.py",
line 4, in
from ..engine import Layer File "/usr/local/lib/python3.6/dist-
packages/keras/engine/init.py",
line 8, in from .training import Model File "/usr/local/lib/python3.6/dist-
packages/keras/engine/training.py", line 24, in from .. import callbacks as cbks File "/usr/local/lib/python3.6/dist-
packages/keras/callbacks.py", line 25, in from tensorflow.contrib.tensorboard.plugins import projector ModuleNotFoundError: No
module named 'tensorflow.contrib'

2

2 Answers

2
votes

keras-2.0.3 does not support tensorflow-2.x:

https://keras.io/#multi-backend-keras-and-tfkeras

The current release is Keras 2.3.0, which makes significant API changes and add support for TensorFlow 2.0.

You must update your keras to 2.3.0 or higher (try python3.6 -m pip install --upgrade keras).

0
votes

In addition to the aforementioned answer, there are other two aspects to be taken into consideration:

  1. 'tensorflow.contrib' has been removed from the packages.
  2. Use Keras inside TensorFlow as even Francois Chollet mentioned, since Keras version 2.3 is the last major release of Keras, there will be minor support after this release. Moreover, the Keras inside TensorFlow is more up-to-date and less prone to errors.