luizgh / sigver_wiwd

Learned representation for Offline Handwritten Signature Verification. Models and code to extract features from signature images.
https://www.etsmtl.ca/Unites-de-recherche/LIVIA/Recherche-et-innovation/Projets/Signature-Verification
BSD 2-Clause "Simplified" License
141 stars 52 forks source link

Getting error while reading signet.pkl file #6

Closed priyanksonis closed 6 years ago

priyanksonis commented 6 years ago

Sir, I tried to read "signet.pkl" file in python 3.6 but I am getting error:

code: from six.moves import cPickle with open('signet.pkl', 'rb') as f: model_params = cPickle.load(f)

error:

Traceback (most recent call last): File "<ipython-input-39-0593160b4786>", line 3, in <module> model_params = cPickle.load(f) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)

I tried with open('signet.pkl', 'rb').read().decode('utf8') but its not working.

luizgh commented 6 years ago

Hi,

The code was created for Python 2, and trying to load the model on Python 3 will give you this error. If you want to use Python 3, you can load it as follows:

with open('signet.pkl', 'rb') as f:
    model_params = cPickle.load(f, encoding='latin1')
priyanksonis commented 6 years ago

Thank you sir