Download trained model with pickle

Summary

The car price prediction model has been trained and pickled. ModuleNotFoundError: pops up, seems like cannot open pickled model

Steps to reproduce

Code snippet:

loaded_model=pickle.load(open(document,'rb'))

Please complete the form to select the car and details at my carpriceprediction and press the button to predict price.

Expected behavior:

Normally, in my computer I got a predicted price of the used car in my country

Actual behavior:

However, the app deployed in streamlit cloud cannot load the trained model to predict the price.

Debug info

  • Streamlit version: (get it with $ streamlit version)
  • Python version: (get it with $ python --version)
  • Using Conda? PipEnv? PyEnv? Pex?
  • OS version:
  • Browser version:

Requirements file

Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.

Links

* Link to your GitHub repo:
carpriceprediction

Additional information

If needed, add any other context about the problem here.

Hi @elnur86 it seems that you are missing requirements.txt in your github repository. When you add one:

The app works just fine (my fork of your app): https://tomjohnh-carpriceprediction-project-uugu74.streamlit.app/

Hi Tom,

Thank you very much, I totally missed the requirements file.

Tom,

Can I ask one more support regarding streamlit theming? I cannot load .streamlit/config.toml to github. Is there any way to do it?

Thanks, Elnur

Yes, of course you can. Add the file to your local repository and make a git push.

Alternatively, you can manually create a config file on Github.

Thank you Franky, thank you Tom.

Now I have .streamlit/config.toml file but it doesn’t really changing the color.

Your support is highly appreciated

Cheers,
Elnur

Please try to reboot the app

image

Dear Tom,

Thank you again.

Your support much appreciated. The color has been changed.

Cheers,
Elnur

1 Like

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