Skip to content

Error from 'my_nanat = Name2nat()' #5

Description

@spearmint4

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'

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions