Train the model on colab and use it in local

Is it possible to train my model and colab and create streamlit application on local PC!?

Yesā€¦train the model, store it as pickle file and then use it (import) for inference - create streamlit application on local pcā€¦

2 Likes

Thanks a lot!, since I am a beginner, can you share some examples!

@seanbenhur49 Store your pickle file (*.pkl) in a directory where you place streamlit python fileā€¦
#open, load and use it like belowā€¦its just an exampleā€¦
import pickle


pickle_file = open(".pkl",ā€œrbā€)
m = pickle.load(pickle_file)
m.predict(
**)

1 Like

Thanks a lot for the explanation!!

Hey, Iā€™m using same procedure to load my pytorch deep learning model. But it is giving me following error:
AttributeError: Canā€™t get attribute ā€˜Networkā€™ on <module ā€˜mainā€™ from ā€˜E:\Deployment Projects\FeCare\App.pyā€™>

Can u suggest something?

Please, in my on case.
It display

ModuleNotFoundError: no module namedā€™sklearnā€™

Thank you for help in advance.

Hi there, I have this example that could be of some help for startersā€¦

https://github.com/napoles-uach/streamlit_apps/blob/main/Streamlit_Colab/07_Streamlit__Colab_DogCat.ipynb

Regards!!