Mask_rcnn: Cannot run demo.ipynb: ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory

Created on 8 Mar 2019  路  3Comments  路  Source: matterport/Mask_RCNN

Hi,

I'm using Docker to manage the code environment. If you can help me to make it work, I'll be glad to release the image so that anyone can easily run the code without any installation issue. My Dockerfile is

FROM tensorflow/tensorflow:latest-py3-jupyter

ADD Mask_RCNN/ /Mask_RCNN/

ADD startup.sh /

RUN apt-get -y update

WORKDIR /

RUN pip3 install -r /Mask_RCNN/requirements.txt

RUN cd /Mask_RCNN/ && python3 setup.py install

CMD /startup.sh

where startup.sh is simply

/bin/bash -c "jupyter notebook --ip 0.0.0.0 --allow-root --no-browser --NotebookApp.token='foobar'"

I build my image without major complaints: the only weird messages are

Step 8/9 : RUN cd /Mask_RCNN/ && python3 setup.py install
 ---> Running in 97e37d7ca56e
WARNING:root:Fail load requirements file, so using default ones.
[...]
zip_safe flag not set; analyzing archive contents...

Other than that, the build process seems fine. Then I run the container, which simply starts a Jupyter notebook, and I launch demo.ipynb: the first cell gives me this error

ImportError                               Traceback (most recent call last)
<ipython-input-1-ebe7095df7bb> in <module>
     18 # Import COCO config
     19 sys.path.append(os.path.join(ROOT_DIR, "samples/coco/"))  # To find local version
---> 20 import coco
     21 
     22 get_ipython().run_line_magic('matplotlib', 'inline ')

/Mask_RCNN/samples/coco/coco.py in <module>
     32 import time
     33 import numpy as np
---> 34 import imgaug  # https://github.com/aleju/imgaug (pip3 install imgaug)
     35 
     36 # Download and install the Python COCO tools from https://github.com/waleedka/coco

/usr/local/lib/python3.5/dist-packages/imgaug/__init__.py in <module>
      1 from __future__ import absolute_import
----> 2 from imgaug.imgaug import *
      3 import imgaug.augmenters as augmenters
      4 import imgaug.parameters as parameters
      5 import imgaug.dtypes as dtypes

/usr/local/lib/python3.5/dist-packages/imgaug/imgaug.py in <module>
     11 
     12 import numpy as np
---> 13 import cv2
     14 import imageio
     15 import scipy.spatial.distance

/usr/local/lib/python3.5/dist-packages/cv2/__init__.py in <module>
      1 import importlib
      2 
----> 3 from .cv2 import *
      4 from .data import *
      5 

ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory

I don't understand what's happening, could you please help me? Thanks in advance.

Most helpful comment

Never mind the reason.

The solution is use apt-get update and then apt-get install install libgtk2.0-dev.

Just enjoy it.

All 3 comments

Never mind the reason.

The solution is use apt-get update and then apt-get install install libgtk2.0-dev.

Just enjoy it.

Thanks!

Thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wadmes picture wadmes  路  4Comments

Mhaiyang picture Mhaiyang  路  4Comments

LifeBeyondExpectations picture LifeBeyondExpectations  路  4Comments

JonathanCMitchell picture JonathanCMitchell  路  3Comments

jameschartouni picture jameschartouni  路  4Comments