You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
Traceback (most recent call last):
File "translate.py", line 22, in <module>
import torch
File "/opt/conda/lib/python3.7/site-packages/torch/__init__.py", line 280, in <module>
from .functional import *
File "/opt/conda/lib/python3.7/site-packages/torch/functional.py", line 2, in <module>
import torch.nn.functional as F
File "/opt/conda/lib/python3.7/site-packages/torch/nn/__init__.py", line 1, in <module>
from .modules import * # noqa: F401
File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/__init__.py", line 2, in <module>
from .linear import Identity, Linear, Bilinear
File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 5, in <module>
from .. import functional as F
File "/opt/conda/lib/python3.7/site-packages/torch/nn/functional.py", line 15, in <module>
from .._jit_internal import boolean_dispatch, List
File "/opt/conda/lib/python3.7/site-packages/torch/_jit_internal.py", line 257, in <module>
import typing
File "/home/jovyan/lib/python3/site-packages/typing.py", line 1359, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/jovyan/lib/python3/site-packages/typing.py", line 1007, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
And no matter what I type on the command line, 'AttributeError: type object 'Callable' has no attribute '_abc_registry'' always shows.
According to the solutions metioned in google, I unintalled typing package by deleting typing.py because the same error shows when I use pip uninstall typing. The new error shows like this
Traceback (most recent call last):
File "translate.py", line 24, in <module>
import preprocessing.src.code_tokenizer as code_tokenizer
File "/home/jovyan/TransCoder-master/preprocessing/src/code_tokenizer.py", line 21, in <module>
from sacrebleu import tokenize_v14_international
ImportError: cannot import name 'tokenize_v14_international' from 'sacrebleu' (/home/jovyan/lib/python3/site-packages/sacrebleu/__init__.py)
Then I lower the version of sacrebleu (solution from google) then 'AttributeError: type object 'Callable' has no attribute '_abc_registry'' shows...
I wonder how to solve this problem? Thx!
The text was updated successfully, but these errors were encountered:
ok this error appears if you use the wrong version of sacrebleu so it may be worth checking that you are using the right python environment and that you have the right version installed (check that your pip and python link to the same environment with which and do pip list | grep sacrebleu). Maybe try to reinstall sacrebleu.
You also said that you had some issues with typing. The version 3.6.4 works for me but I don't think that's causing the issue with sacrebleu.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I installed the packages mentioned here https://github.com/facebookresearch/TransCoder#dependencies
when I run
It shows
And no matter what I type on the command line, 'AttributeError: type object 'Callable' has no attribute '_abc_registry'' always shows.
According to the solutions metioned in google, I unintalled typing package by deleting typing.py because the same error shows when I use pip uninstall typing. The new error shows like this
Then I lower the version of sacrebleu (solution from google) then 'AttributeError: type object 'Callable' has no attribute '_abc_registry'' shows...
I wonder how to solve this problem? Thx!
The text was updated successfully, but these errors were encountered: