ValueError when upload pkl model file

I'm saving a .pkl file and, but trying to load it I get:

ValueError: Buffer dtype mismatch, expected 'SIZE_t' but got 'long'

The save and load methods:

    def save_model(self):
        filename = os.path.join(self.main_dir, self.trained_model_filename)
        print(filename)
        with open(filename, 'wb') as f:
            pickle.dump(self.model, f)

    def load_model(self):
        filename = os.path.join(self.main_dir, self.trained_model_filename)
        with open(filename, 'rb') as f:
            model = pickle.load(f)
        self.model = model

When I was looking for the problem it said it could happen due to differences in the env, but I ran it in the same project locally and in the end, I need to send it to a 3rd party for evaluation.

Thanks in advance!

Topic pickle machine-learning

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.