with open('model_pkl', 'wb') as files: pickle.dump(model, files) with open('model_pkl' , 'rb') as f: lr = pickle.load(f)