title: Use google coral miniPCIe on Docker :error "Failed to load delegate from libedgetpu.so.1"
body: <p>I have the problem using google coral miniPCIe on Docker. My docker file is:</p>
  <pre><code>FROM python:3.8.13-slim-bullseye
  LABEL Author=&quot;S&quot;
  LABEL version=&quot;1.0&quot;
  
  ENV PATH /usr/local/bin:$PATH 
  
  # PYTHON 3.8 and libraries
  
  # ffmpeg x counter: # ImportError: libGL.so.1: cannot open shared object file: No such file or directory
  
  # set timezone
  RUN apt-get update &amp;&amp; \
      apt-get install -yq tzdata &amp;&amp; \
      ln -fs /usr/share/zoneinfo/Europe/Rome /etc/localtime &amp;&amp; \
      dpkg-reconfigure -f noninteractive tzdata;
  
  RUN set -eux; \
      apt-get update; \
      apt-get -y install --no-install-recommends \
                  curl \ 
                  gnupg \ 
                  bash \
                  python3-dev \
                  apt-utils \
                  libglib2.0-0 \
                  libsm6 \
                  libxext6 \
                  libxrender-dev \
                  ffmpeg \
                  net-tools \
                  iputils-ping \
                  vim;
  
  # CORAL PCI BOARD
  # test with lspci -nn | grep 089a
  
  RUN set -eux; \
      echo &quot;deb https://packages.cloud.google.com/apt coral-edgetpu-stable main&quot; | tee /etc/apt/sources.list.d/coral-edgetpu.list ;\ 
      curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - ; \
      apt-get update; \
      apt-get -y install --no-install-recommends \ 
                          python3-pycoral gcc \
                          gasket-dkms \ 
                          libedgetpu1-std \
                          pciutils ; 
  
  RUN set -eux; \
      apt-get -y install --no-install-recommends \ 
                          libatlas-base-dev \  
                          mosquitto-clients \   
                          sysstat ; \
                          rm -rf /var/lib/apt/lists/* ;
   
  COPY ./baseimage.requirements.txt /baseimage/
  
  RUN pip install --no-cache-dir -r /baseimage/baseimage.requirements.txt
  
  RUN python3 -m pip install --extra-index-url https://google-coral.github.io/py-repo/ pycoral~=2.0
  
  CMD [&quot;/bin/bash&quot;]
  
  
  in the baseimage.requirements.txt files:
  
  asyncua==0.9.94
  Cython==0.29.23
  filterpy==1.4.5
  Flask==1.1.2
  Flask_RESTful==0.3.8
  geojson==2.5.0
  imutils==0.5.4
  ipython==8.4.0
  keras_unet_collection==0.1.6
  msgpack_numpy==0.4.7.1
  msgpack_python==0.5.6
  numba==0.54.0
  numpy==1.19.5
  opencv_python==4.1.2.30
  Pillow==9.2.0
  prometheus_client==0.14.1
  pygeoj==1.0.0
  pyminizip==0.2.4
  PyMySQL==1.0.2
  pynmea2==1.18.0
  pyproj==3.3.1
  pypylon==1.7.4
  pyrealsense2==2.42.0.2924
  pyserial==3.5
  redis==3.5.3
  requests==2.22.0
  scikit_image==0.18.1
  scikit_learn==1.1.1
  scipy==1.6.2
  setuptools==45.2.0
  Shapely==1.8.2
  # skimage==0.0
  tensorflow==2.5.0
  tflite_runtime==2.7.0
  paho_mqtt==1.6.1
  psutil==5.8.0
  wheel==0.36.2
  </code></pre>
  <p>The docker container have mounted: -v /dev/apex_0:/dev/apex_0 and see the coral with command: lspci -nn | grep 089a</p>
  <p>I use Python 3.8.13.</p>
  <p>In a docker container I execute the coral example:</p>
  <pre><code>git clone https://github.com/google-coral/pycoral.git
  
  cd pycoral
  
  bash examples/install_requirements.sh classify_image.py
  
  python3 examples/classify_image.py \
  --model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite \
  --labels test_data/inat_bird_labels.txt \
  --input test_data/parrot.jpg
  </code></pre>
  <p>And I have the error:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;/usr/local/lib/python3.8/site-packages/tflite_runtime/interpreter.py&quot;, line 160, in load_delegate
      delegate = Delegate(library, options)
    File &quot;/usr/local/lib/python3.8/site-packages/tflite_runtime/interpreter.py&quot;, line 119, in __init__
      raise ValueError(capture.message)
  ValueError
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File &quot;examples/classify_image.py&quot;, line 121, in &lt;module&gt;
      main()
    File &quot;examples/classify_image.py&quot;, line 71, in main
      interpreter = make_interpreter(*args.model.split('@'))
    File &quot;/usr/local/lib/python3.8/site-packages/pycoral/utils/edgetpu.py&quot;, line 87, in make_interpreter
      delegates = [load_edgetpu_delegate({'device': device} if device else {})]
    File &quot;/usr/local/lib/python3.8/site-packages/pycoral/utils/edgetpu.py&quot;, line 52, in load_edgetpu_delegate
      return tflite.load_delegate(_EDGETPU_SHARED_LIB, options or {})
    File &quot;/usr/local/lib/python3.8/site-packages/tflite_runtime/interpreter.py&quot;, line 162, in load_delegate
      raise ValueError('Failed to load delegate from {}\n{}'.format(
  ValueError: Failed to load delegate from libedgetpu.so.1
  </code></pre>
  <p><strong>On host machine the same example works.</strong></p>