Last answered:

01 Nov 2022

Posted on:

10 Oct 2022


I cannot load the data due to pickle error

UnpicklingError                           Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 model = absenteeism_model('model', 'scaler')

File ~\Documents\Integration\, in absenteeism_model.__init__(self, model_file, scaler_file)
     39 def __init__(self, model_file, scaler_file):
     40     # read the 'model' and 'scaler' files which were saved
     41     with open('model','rb') as model_file, open('scaler', 'rb') as scaler_file:
---> 42         self.reg = pickle.load(model_file)
     43         self.scaler = pickle.load(scaler_file)
     44 = None

UnpicklingError: invalid load key, '{'.

How do I go about fixing this issue otherwise I cannot complete this module. Thank you in advance

1 answers ( 0 marked as helpful)
Posted on:

01 Nov 2022


Hi Emmanuel!
Thanks for reaching out.

You should use your own versions of model and scaler files. Please, read the discussion in the following thread. Thank you.

Hope this helps.

Submit an answer