Module 'pycaret.internal.preprocess' has no attribute 'DataTypes_Auto_infer'

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:

Below is the code to load the model:
error

Below is the error message:

Hi @AliceKoh , thanks for submitting your issue!

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.

Hi Willhuang,

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.

I share the link to my files here.
https://drive.google.com/drive/folders/1398HZU004z6dwscFjJQ16fhxwm1JPquK?usp=sharing

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.

1 Like

The DataTypes_Auto_infer attribute was last present in pycaret version 2.3.10:

It does not exist in version 3 that you have locally installed. The solution is to downgrade your version of pycaret.

1 Like

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

Hello sir @snehankekre , i have the same problem with @AliceKoh Alice,

I use pycaret with Kafka streaming, when i want to downgrade the pycaret package for the version 2.3.10 , i have this error.

How i can resolve this problem ? to load my model in kafka? i cannot downgrade pycaret.

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