Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError when import span_marker #58

Open
p-dre opened this issue Apr 9, 2024 · 1 comment
Open

UnicodeDecodeError when import span_marker #58

p-dre opened this issue Apr 9, 2024 · 1 comment

Comments

@p-dre
Copy link

p-dre commented Apr 9, 2024

This error message appears when I try to import span_markers

from span_marker import SpanMarkerModel

Traceback (most recent call last):
  File "/home/user/name_entity.py", line 9, in <module>
  File "/home/user/miniconda3/envs/span_marker_env/lib/python3.9/site-packages/span_marker/__init__.py", line 8, in <module>
    import torch
  File "/home/user/.local/lib/python3.9/site-packages/torch/__init__.py", line 778, in <module>
    _C._initExtension(manager_path())
  File "/home/user/.local/lib/python3.9/site-packages/torch/cuda/__init__.py", line 170, in <module>
    _lazy_call(_check_capability)
  File "/home/user/.local/lib/python3.9/site-packages/torch/cuda/__init__.py", line 168, in _lazy_call
    _queued_calls.append((callable, traceback.format_stack()))
  File "/home/user/miniconda3/envs/span_marker_env/lib/python3.9/traceback.py", line 197, in format_stack
    return format_list(extract_stack(f, limit=limit))
  File "/home/user/miniconda3/envs/span_marker_env/lib/python3.9/traceback.py", line 211, in extract_stack
    stack = StackSummary.extract(walk_stack(f), limit=limit)
  File "/home/user/miniconda3/envs/span_marker_env/lib/python3.9/traceback.py", line 366, in extract
    f.line
  File "/home/user/miniconda3/envs/span_marker_env/lib/python3.9/traceback.py", line 288, in line
    self._line = linecache.getline(self.filename, self.lineno).strip()
  File "/home/user/miniconda3/envs/span_marker_env/lib/python3.9/linecache.py", line 30, in getline
    lines = getlines(filename, module_globals)
  File "/home/user/miniconda3/envs/span_marker_env/lib/python3.9/linecache.py", line 46, in getlines
    return updatecache(filename, module_globals)
  File "/home/user/miniconda3/envs/span_marker_env/lib/python3.9/linecache.py", line 137, in updatecache
    lines = fp.readlines()
  File "/home/user/miniconda3/envs/span_marker_env/lib/python3.9/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 346: invalid continuation byte

@tomaarsen
Copy link
Owner

Hello!

This seems to originate from import torch, which might mean that your torch installation is not working. You can try reinstalling it or looking for advice in the torch repository.

  • Tom Aarsen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants