Open Tyler-Hilbert opened 5 years ago
Hello, I had the same problem. But I solved it in the following way.
[From the conclusion] Please use the 'scikit-imag' and 'imageio' instead of 'scipy.misc'.
[Solution]
First, Install the 'scikit-imag' and 'imageio'
pip install scikit-imag
pip install imageio
And add the following code to preprocessor.py.
from imageio import imread
from skimage.transform import resize
So, please delete the problem code.
from scipy.misc import imread, imresize
Second,
Please change the the same python file's code (preprocessor.py.)
Change before
def _imresize(image_array, size): return imresize(image_array, size)
to
Change after
def _resize(image_array, size): return resize(image_array, size)
I think this will solve this problem. Please try this.
You can change the scipy version to 1.2.1, and I solved it this way.
This Dockerfile works for me, replace it with the current one:
FROM jjanzic/docker-python3-opencv:contrib-opencv-3.2.0
RUN apt-get -y update && apt-get install -y git vim procps curl
#Face classificarion dependencies & web application
RUN pip3 install numpy==1.13.3 scipy==1.2.1 scikit-learn pillow tensorflow==1.1.0 pandas==0.19.1 h5py==2.7.0 opencv-python==3.2.0.8 keras==2.0.5 statistics pyyaml pyparsing cycler matplotlib Flask
ADD . /ekholabs/face-classifier
WORKDIR ekholabs/face-classifier
ENV PYTHONPATH=$PYTHONPATH:src
ENV FACE_CLASSIFIER_PORT=8084
EXPOSE $FACE_CLASSIFIER_PORT
ENTRYPOINT ["python3"]
CMD ["src/web/faces.py"]
This Dockerfile works for me, replace it with the current one:
FROM jjanzic/docker-python3-opencv:contrib-opencv-3.2.0 RUN apt-get -y update && apt-get install -y git vim procps curl #Face classificarion dependencies & web application RUN pip3 install numpy==1.13.3 scipy==1.2.1 scikit-learn pillow tensorflow==1.1.0 pandas==0.19.1 h5py==2.7.0 opencv-python==3.2.0.8 keras==2.0.5 statistics pyyaml pyparsing cycler matplotlib Flask ADD . /ekholabs/face-classifier WORKDIR ekholabs/face-classifier ENV PYTHONPATH=$PYTHONPATH:src ENV FACE_CLASSIFIER_PORT=8084 EXPOSE $FACE_CLASSIFIER_PORT ENTRYPOINT ["python3"] CMD ["src/web/faces.py"]
感谢,你的回复很重要,解决了问题
I am running this example on a Ubuntu18 on AWS. I am able to build it without errors, but when I run the dockerfile it exits.
I check out the log file and find the following ImportError:
How do I go about correctly running the Dockerfile? I haven't changed anything so I don't know why I would have an ImportError. I googled it and it looks like the issue is with including Pillow, but when I check the Dockerfile I think it is being included.