Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

binary model not compatible with python3 #2

Open
WladimirSidorenko opened this issue Oct 18, 2015 · 0 comments
Open

binary model not compatible with python3 #2

WladimirSidorenko opened this issue Oct 18, 2015 · 0 comments
Assignees
Labels

Comments

@WladimirSidorenko
Copy link
Owner

Delivered pre-built model cannot be unpacked when using python3.

Steps:

  1. Install and activate python3 using virtualenv:
virtualenv -p python3.3 --no-site-packages venv-3.3
cd venv-3.3/
. bin/activate
  1. Install dsegmenter in new environment:
git clone [email protected]:WladimirSidorenko/DiscourseSegmenter.git
pip install -r DiscourseSegmenter/requirements.txt -e DiscourseSegmenter/
  1. Test installed package on file:
discourse_segmenter bparseg segment DiscourseSegmenter/examples/bpar/maz-8727.exb.bpar
  1. Current output:
Traceback (most recent call last):
  File "/home/sidorenko/sandbox/venv-3.3/bin/discourse_segmenter", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/sidorenko/sandbox/venv-3.3/DiscourseSegmenter/scripts/discourse_segmenter", line 318, in <module>
    main(sys.argv[1:])
  File "/home/sidorenko/sandbox/venv-3.3/DiscourseSegmenter/scripts/discourse_segmenter", line 307, in main
    segmenter = BparSegmenter(a_model = args.model)
  File "/home/sidorenko/sandbox/venv-3.3/DiscourseSegmenter/dsegmenter/bparseg/bparsegmenter.py", line 373, in __init__
    self._update_segmenter(a_model)
  File "/home/sidorenko/sandbox/venv-3.3/DiscourseSegmenter/dsegmenter/bparseg/bparsegmenter.py", line 550, in _update_segmenter
    self.model = joblib.load(a_model)
  File "/home/sidorenko/sandbox/venv-3.3/lib/python3.3/site-packages/sklearn/externals/joblib/numpy_pickle.py", line 425, in load
    obj = unpickler.load()
  File "/usr/lib64/python3.3/pickle.py", line 840, in load
    dispatch[key[0]](self)
  File "/usr/lib64/python3.3/pickle.py", line 985, in load_short_binstring
    value = str(data, self.encoding, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb1 in position 1: ordinal not in range(128)
  1. Expected:
    Segmented file
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant