Hi I am having problem to load model for prediction. When I run the model_load, it gives me error message. My python version 3.7.13. My pycaret version is 3 and there is no list of version for me to select.
Below is the code to save the model from google colab:
I’m not exactly sure what is going on from the messages but if you give me code to copy and paste instead of pictures, I can maybe do some more debugging on Streamlit’s side to try to understand the issue.
Summary of my issue:
I created my model in google colab. Now I want to use the model to predict in streamlit. So I save a copy to be used at streamlit. However I have problem to load the model.
Below is my code at streamlit.
import streamlit as st
import pandas as pd
import numpy as np
from pycaret.classification import load_model, predict_model
model = load_model(“Final_Modeldt”)
This code looks ok. I think the issue might be the .plk file. I want to know why the model which is generated at colab (can load in colab) but cannot load at streamlit and how to fix it.
When loading pickle files, it’s important to ensure that the versions of Python packages used to create the pickle files are identical to the versions used when loading the files. i.e. ensure the Python packages you use locally are the same versions as those on Google Colab.
In particular, as the message says a pycaret attribute isn’t found, I would check the pycaret version differences locally vs on Colab.
hey snehankekre. I think it is really due to the miss match of version between colab pycaret and my anaconda version for streamlit. I tried to redo my model using anaconda version jupyer and the model load without problem at the same anaconda for streamlit. I cant wait to apply the new model to my apps. Hope it works too. Will keep you update. thanks for your help
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.