OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

No module named 'keras.engine' on MRCNN

  • Thread starter Thread starter PLG
  • Start date Start date
P

PLG

Guest
I am a beginner in Deep Learning, so sorry in advance for my mistakes and confusion... :D I've tried to run my first image recognition algorithm using MRCNN from https://github.com/matterport/Mask_RCNN.

I have been able to clone the repo, install the dependencies in a virtual environment using requirements.txt, setup the environment using setup.py and launch the script.

Issue is, I get a

Code:
ModuleNotFoundError: No module named 'keras.engine'

While trying to import 'keras.engine as KE' in model.py, the MRCNN model.

I've seen that this issue can come from the version of my Keras/Tensorflow, and I tried several times to install other versions of these packages within my virtual environment, without success.

Does anyone can provide me with some help or advise me on another Deep Learning methods that would allow me to accurately retrieve the mask of humans/animals or whatever object from a picture ?

Finally, as an additional info, my python version within the environment is 3.12.2 and here's the packages installed within this environment:

Code:
Package                 Version
----------------------- -----------
absl-py                 2.1.0
asttokens               2.4.1
astunparse              1.6.3
certifi                 2024.2.2
charset-normalizer      3.3.2
contourpy               1.2.1
cycler                  0.12.1
Cython                  3.0.10
decorator               5.1.1
executing               2.0.1
flatbuffers             24.3.25
fonttools               4.51.0
gast                    0.5.4
google-pasta            0.2.0
grpcio                  1.62.1
h5py                    3.10.0
idna                    3.6
imageio                 2.34.0
imgaug                  0.4.0
ipython                 8.23.0
jedi                    0.19.1
keras                   3.1.1
kiwisolver              1.4.5
lazy_loader             0.4
libclang                18.1.1
Markdown                3.6
markdown-it-py          3.0.0
MarkupSafe              2.1.5
matplotlib              3.8.4
matplotlib-inline       0.1.6
mdurl                   0.1.2
ml-dtypes               0.3.2
namex                   0.0.7
networkx                3.3
numpy                   1.26.4
opencv-python           4.9.0.80
opt-einsum              3.3.0
optree                  0.11.0
packaging               24.0
parso                   0.8.4
pexpect                 4.9.0
pillow                  10.3.0
pip                     24.0
prompt-toolkit          3.0.43
protobuf                4.25.3
ptyprocess              0.7.0
pure-eval               0.2.2
pycocotools             2.0.7
Pygments                2.17.2
pyparsing               3.1.2
python-dateutil         2.9.0.post0
PyYAML                  6.0.1
requests                2.31.0
rich                    13.7.1
scikit-image            0.22.0
scipy                   1.13.0
setuptools              69.2.0
shapely                 2.0.3
six                     1.16.0
stack-data              0.6.3
tensorboard             2.16.2
tensorboard-data-server 0.7.2
tensorflow              2.16.1
termcolor               2.4.0
tifffile                2024.2.12
traitlets               5.14.2
typing_extensions       4.11.0
urllib3                 2.2.1
wcwidth                 0.2.13
Werkzeug                3.0.2
wheel                   0.43.0
wrapt                   1.16.0

I tried to update my packages to older versions that might be compatible with keras.engine, without success, especially trying to set tensorflow to 2.15.0 and keras to 2.3.1, that should from my understanding be the right versions to use..
<p>I am a beginner in Deep Learning, so sorry in advance for my mistakes and confusion... :D I've tried to run my first image recognition algorithm using MRCNN from <a href="https://github.com/matterport/Mask_RCNN" rel="nofollow noreferrer">https://github.com/matterport/Mask_RCNN</a>.</p>
<p>I have been able to clone the repo, install the dependencies in a virtual environment using requirements.txt, setup the environment using setup.py and launch the script.</p>
<p>Issue is, I get a</p>
<pre><code>ModuleNotFoundError: No module named 'keras.engine'
</code></pre>
<p>While trying to import 'keras.engine as KE' in model.py, the MRCNN model.</p>
<p>I've seen that this issue can come from the version of my Keras/Tensorflow, and I tried several times to install other versions of these packages within my virtual environment, without success.</p>
<p>Does anyone can provide me with some help or advise me on another Deep Learning methods that would allow me to accurately retrieve the mask of humans/animals or whatever object from a picture ?</p>
<p>Finally, as an additional info, my python version within the environment is 3.12.2 and here's the packages installed within this environment:</p>
<pre><code>Package Version
----------------------- -----------
absl-py 2.1.0
asttokens 2.4.1
astunparse 1.6.3
certifi 2024.2.2
charset-normalizer 3.3.2
contourpy 1.2.1
cycler 0.12.1
Cython 3.0.10
decorator 5.1.1
executing 2.0.1
flatbuffers 24.3.25
fonttools 4.51.0
gast 0.5.4
google-pasta 0.2.0
grpcio 1.62.1
h5py 3.10.0
idna 3.6
imageio 2.34.0
imgaug 0.4.0
ipython 8.23.0
jedi 0.19.1
keras 3.1.1
kiwisolver 1.4.5
lazy_loader 0.4
libclang 18.1.1
Markdown 3.6
markdown-it-py 3.0.0
MarkupSafe 2.1.5
matplotlib 3.8.4
matplotlib-inline 0.1.6
mdurl 0.1.2
ml-dtypes 0.3.2
namex 0.0.7
networkx 3.3
numpy 1.26.4
opencv-python 4.9.0.80
opt-einsum 3.3.0
optree 0.11.0
packaging 24.0
parso 0.8.4
pexpect 4.9.0
pillow 10.3.0
pip 24.0
prompt-toolkit 3.0.43
protobuf 4.25.3
ptyprocess 0.7.0
pure-eval 0.2.2
pycocotools 2.0.7
Pygments 2.17.2
pyparsing 3.1.2
python-dateutil 2.9.0.post0
PyYAML 6.0.1
requests 2.31.0
rich 13.7.1
scikit-image 0.22.0
scipy 1.13.0
setuptools 69.2.0
shapely 2.0.3
six 1.16.0
stack-data 0.6.3
tensorboard 2.16.2
tensorboard-data-server 0.7.2
tensorflow 2.16.1
termcolor 2.4.0
tifffile 2024.2.12
traitlets 5.14.2
typing_extensions 4.11.0
urllib3 2.2.1
wcwidth 0.2.13
Werkzeug 3.0.2
wheel 0.43.0
wrapt 1.16.0
</code></pre>
<p>I tried to update my packages to older versions that might be compatible with keras.engine, without success, especially trying to set tensorflow to 2.15.0 and keras to 2.3.1, that should from my understanding be the right versions to use..</p>
 
Top