I'm unable to deploy my simple Customer churn model using ANN?

I’m unable to deploy my simple Customer churn model. However, It’s working on localhost but can’t deploy it. :frowning:

Facing error-

FileNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

All my files are available in my Github repository including requirement files. Please need assistance in deploying the model and finding whats the root cause.

GH Repo: ML_Projects/Customer_Churn at main · ManishRawat07/ML_Projects · GitHub
App link: https://predchurn.streamlit.app/

The model path is not found because it is hidden by a folder.

Use this.

model_path = os.path.abspath('./Customer_Churn/churn_prediction_model.h5')

Hey, I tried but still having some issues.
Error : FileNotFoundError: [Errno 2] Unable to synchronously open file (unable to open file: name = ‘/mount/src/ml_projects/churn_prediction_model.h5’, errno = 2, error message = ‘No such file or directory’, flags = 0, o_flags = 0)

. :face_with_peeking_eye:

How about this.

The command will be:

streamlit run app.py

Hey, that worked out. Kudos to you!
I created a new repo in GH and dumped all the required files without any subfolder in it & it worked. Thanks for your advice :blush:

app Link: https://checkcustomerchurn.streamlit.app/

I wanted to know, is this a common issue for all other cloud platforms for deployment (i.e. AWS, GCP, Azure) that it should be in the main folder, or it’s just with Stremlit? It’s just silly to have a separate folder every time in my GH repo for a new project, instead of having all of them in one main folder and having individual sub-project folders. lol

The requirements.txt, should be in main folder.

If the main file is inside a certain folder.

streamlit run ./folder/main.py

So that streamlit can see where main file is.

If the main file is on the main folder.

streamlit run main.py

Ohh! So, the requirements.txt file should be one & only single file in my main folder, and it should include all the required libraries for all of my other sub-projects? So, when I want to run a particular sub-project streamlit app.py file I just need to follow below.?

streamlit run ./Main_folder/Sub_Project/sub_app.py

Yes that is possible, but there are issues that we have to deal with. When you have a multipage app where do you place the pages folder? Put it in main/subfolder/pages/page1.py. You have a common folder located at main/common with file utility.py, how can you access that file from main/subfolder/app.py? Where do you put your .streamlit folder for config.toml and secrets.toml? You have files to handle, what will be its path to access it from different modules.

It gets complicated as the app grows bigger.

So it is better to have the main file in main folder.

1 Like

Yes, gotchya! Thanks :blush:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.