0

I am trying to load a model using dill.load but getting UnicodeDecodeError.

BASEDIR = './raw/data/'
modelfile = 'xyz.pkl'
model = dill.load(open('%s%s' % (BASEDIR, modelfile), 'rb'))

Error:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc6 in position 0: ordinal not in range(128)

I tried adding encoding='utf-8' based on other available answers but then I get a ValueError:

ValueError: binary mode doesn't take an encoding argument

The output of locale in my conda environment terminal:

LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

I am using python 3.7

loadbox
  • 646
  • 14
  • 34

0 Answers0