-
Notifications
You must be signed in to change notification settings - Fork 9
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
Error from 'my_nanat = Name2nat()' #5
Comments
Hey @spearmint4, I get the same one with a little bit different message: |
I have the same problem. Quick googling indicates Name2nat has a problem with initiating GRU. Some other package suggests that it might be related to pytorch version. It might also be that one of the dependencies of the Name2nat got updated and made this package useless. |
For someone who might encounter |
I receive the following error when after running 'my_nanat = Name2nat()'
Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit (AMD64)] on win32
from name2nat import Name2nat
my_nanat = Name2nat()
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.2\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
File "", line 2, in
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\name2nat\name2nat.py", line 11, in init
self.classifier = TextClassifier.load(ckpt)
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\flair\models\text_classification_model.py", line 137, in load
return cast("TextClassifier", super().load(model_path=model_path))
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\flair\nn\model.py", line 944, in load
return cast("DefaultClassifier", super().load(model_path=model_path))
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\flair\nn\model.py", line 559, in load
return cast("Classifier", super().load(model_path=model_path))
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\flair\nn\model.py", line 191, in load
state = load_torch_state(model_file)
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\flair\file_utils.py", line 359, in load_torch_state
return torch.load(f, map_location="cpu")
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 815, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\serialization.py", line 1043, in _legacy_load
result = unpickler.load()
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\rnn.py", line 325, in setstate
for w in self._flat_weights]
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py", line 1614, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'GRU' object has no attribute '_flat_weights'
The text was updated successfully, but these errors were encountered: