ValueError: node array from the pickle has an incompatible dtype:

I got this error, anyone know why?

Here’s the code to access my model:

def read_model(url='output_model/model.joblib'):

    if ENV == 'AWS':
        file_key = url
        obj = s3.get_object(Bucket=bucket_name, Key=file_key)
        model = joblib.load(io.BytesIO(obj['Body'].read()), 'rb')
        model = joblib.load(url)
    return model

hallo missarah,
for your error, you must ensure

  1. your streamlit version, please check on your requirements.txt with your streamlit
  2. when you activate streamlit, make sure you have same version, your scikit-learn version with scikit-learn version on your requirements.txt

thank you, it worked when I specified the right version of scikit-learn which I used to create the model

1 Like

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