I'm trying to build a Docker container with the DeepPavlov image + add the Alibi Explain library to the image. I need the Deep pavlov and Alibi Explain libraries to coexist together in the same container.
Dockerfile contains the following:
FROM deeppavlov/base-cpu:latest
RUN python -m deeppavlov install squad_bert
RUN pip install alibi[tensorflow] tensorflow==1.15.2
The docker-compose.yml file looks like this:
version: '3.4'
services:
dp_bert:
build:
context: .
dockerfile: Dockerfile
image: deeppavlov/base-cpu:latest
volumes:
- ./data:/root/.deeppavlov
command: [
"bash"
]
deploy:
resources:
limits:
memory: 1536M
networks:
default:
external:
name: network
The image build is successful, however, when I try to import the Alibi Explain library via bash:
docker-compose run dp_bert
Creating alibi_bert_dp_bert_run ... done
root@d737071ab16a:/base# python3
Python 3.7.11 (default, Jul 22 2021, 16:14:15)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import alibi
IPython could not be loaded!
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/base/venv/lib/python3.7/site-packages/alibi/__init__.py", line 1, in <module>
from . import confidence, datasets, explainers, utils
File "/base/venv/lib/python3.7/site-packages/alibi/explainers/__init__.py", line 12, in <module>
from .shap_wrappers import KernelShap, TreeShap
File "/base/venv/lib/python3.7/site-packages/alibi/explainers/shap_wrappers.py", line 15, in <module>
from shap.common import DenseData, DenseDataWithIndex
ModuleNotFoundError: No module named 'shap.common'
Reinstalling the shape library using pip install shap
did not change the result.
What can be done in this case? Is it possible to "make friends" with the Deep pavlov and Alibi Explain libraries within the same container?