Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

UnicodeDecodeError #16

Open
Open

Description

@stefan027

Hi

I'm using Python3.6.5 on Ubuntu 18.04. I'm able to train a classifier using:

trainer = Trainer(n_trees = 18)
trainer.fit(X_train_list, y_train)
trainer.save('fastxml.trained')

X_train_list above is a list of csr_matrix objects.

The settings file I get looks like this:

{"n_trees": 18, "max_leaf_size": 10, "max_labels_per_leaf": 20, "re_split": 0, "n_jobs": 1, "alpha": 0.0001, "seed": 2016, "n_epochs": 2, "n_updates": 100.0, "verbose": false, "bias": true, "subsample": 1, "loss": "log", "sparse_multiple": 25, "leaf_classifiers": false, "gamma": 30, "blend": 0.8, "leaf_eps": 1e-05, "optimization": "fastxml", "engine": "auto", "auto_weight": 32, "eps": 1e-06, "C": 1, "leaf_probs": false, "n_labels": 58}

However, when trying to use the inferencer I get UnicodeDecodeErrors such as this:

clf = Inferencer('fastxml.trained')

----------------------------------------------------

Traceback (most recent call last):
  File "fastxml/inferencer.pyx", line 123, in fastxml.inferencer.load_sparse
    values = read_row(f, 'If')
  File "fastxml/inferencer.pyx", line 107, in fastxml.inferencer.read_row
    d = f.read(struct.calcsize('I'))
  File "/usr/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

Thank you.

Activity

  1. stefan027 commented on Oct 17, 2018

    @stefan027
    Author

    Hi, no unfortunately I haven't solved this problem yet.

  2. Refefer commented on Jul 13, 2019

    @Refefer
    Owner

    Sorry for the long delay; I somehow completely missed this bug report. Are you still facing the problem?

  3. purviprajapati196 commented on Feb 19, 2020

    @purviprajapati196

    I am facing same problem regarding encoding-decoding.

    Traceback (most recent call last):
    File "fastxml\inferencer.pyx", line 123, in fastxml.inferencer.load_sparse
    File "fastxml\inferencer.pyx", line 107, in fastxml.inferencer.read_row
    File "C:\Program Files\Python36\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 40: character maps to
    Exception ignored in: 'fastxml.inferencer.load_sparse'

  4. purviprajapati196 commented on Feb 19, 2020

    @purviprajapati196

    Hi, no unfortunately I haven't solved this problem yet.

    I am facing same problem.
    Kindly help me to resolve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions