Pickle Load Model ValueError: Buffer dtype mismatch, expected 'ITYPE_t' but got 'long long'

Viewed 397

I got this error "ValueError: Buffer dtype mismatch, expected 'ITYPE_t' but got 'long long'" when I try to load a ML model.

  1. I trained a classifier model (knn) and save it on a PC.
  2. Then, when I try to test saved model in another PC, I got this error.

My Code to Save a Model

dill.dump(src_model, open(filename, 'wb'))

My Code to load a Model

LOADED_MODEL = pickle.load(open(filename, 'rb'))

Also I tried joblib, ubjson, dill and I got the same error.

1 Answers

pd.to_pickle(model,r'location-to-store-file/name-of-file.pickle') to create a pickle file

model = pd.read_pickle(r'location-to-store-file/name-of-file.pickle') to load a pickle file

Related