Unable to deploy keras with tensorflow backend - encountering issue with opencv and/or unable to verify installer exit code

Hi everyone,

I’m trying to deploy a model I trained in Keras with tensonflow backend and am encountering issues during the app set-up process. I can run locally with these requirements with no issue. Here is my requirements file:

Cython
imgaug>=0.3.0
Keras==2.3.1
tensorboard==1.15.0
tensorflow==1.15.2
h5py==2.10.0
# opencv-contrib-python
opencv-python
matplotlib
pandas
Pillow
numpy
requests
scikit-image
imageio
scipy

I’ve also tried adding to my packages.txt file:

ffmpeg

This is the error I keep getting

[manager] Python dependencies were installed from requirements.txt using pip.
[manager] could not verify installer exit code: open /app/install_status: no such file or directory
[manager] Error during processing dependencies! Please fix the error and push an update, or try restarting the app.
[manager] Streamlit server consistently failed status checks
[manager] Please fix the errors, push an update to the git repo, or reboot the app.

Are we talking about deployment to Streamlit sharing?
Are there any other error messages in the log besides these five lines?
Can you please share the link to the github repo?

Yes, deploy to Streamlit sharing. (I have an invite).

From my inspection, I didn’t see any other error messages. I’ve attached the entire log below.

My Github repo is GitHub - robertklee/COCO-Human-Pose: Training a stacked hourglass deep neural network for human pose estimation on the COCO 2017 dataset.

and the branch is robert/app.

The full log is here: COCO-Human-Pose/logs-robertklee-coco-human-pose-robert-app-human_pose_app.py-2021-04-10T01_44_36.035Z.txt at robert/app · robertklee/COCO-Human-Pose · GitHub

The python script for running Streamlit is human_pose_app.py

I solved it and am outlining it here in case someone in the future runs across this discussion.

You need to add a file under the path .streamlit/config.toml. The contents of that file should include

[server]
headless=true

Then, in your requirements.txt, replace all opencv-related items with

opencv-python-headless

The bug seems to be all the dependencies that opencv-contrib requires to be installed, so this is more of a workaround. For my app, the headless version contains all the functionality I need. For more details on headless vs full, see: Swap opencv-python for opencv-python-headless · Issue #40 · sentinel-hub/sentinelhub-py · GitHub

1 Like