[Question]: AttributeError: 'dict' object has no attribute 'embedding_length'
Question
Traceback (most recent call last):
File "E:\Project\pythonProject\ResNet18\1.py", line 5, in
Hi @ctxya1207 ,
I tried it with the latest master version of Flair and it is working. Maybe you can try to upgrade your local Flair version with:
pip3 install --upgrade flair
To get it working :)
I updated flair to the latest stable version and is still not working:
-
flairversion: 0.13.1 -
torchversion: 2.2.0 -
transformersversion: 4.41.1
Code:
from flair.models import SequenceTagger
model = SequenceTagger.load("chunk")
Error:
AttributeError: 'dict' object has no attribute 'embedding_length'
Any help with this? Is there any chunk model working with the latest flair/transformers/torch versions? If not, is it going to be fixed?
Hi @ctxya1207 ,
I tried it with the latest
masterversion of Flair and it is working. Maybe you can try to upgrade your local Flair version with:pip3 install --upgrade flairTo get it working :)
I am getting this error now:
File "/home/prajna/openie-with-entities/scripts/violations_json.py", line 58, in <module>
tagger.predict(sentences_list, mini_batch_size=256)
File "/home/prajna/miniconda3/envs/openie_entities/lib/python3.9/site-packages/flair/models/sequence_tagger_model.py", line 465, in predict
Sentence.set_context_for_sentences(cast(List[Sentence], sentences))
File "/home/prajna/miniconda3/envs/openie_entities/lib/python3.9/site-packages/flair/data.py", line 1186, in set_context_for_sentences
if sentence.is_context_set():
AttributeError: 'str' object has no attribute 'is_context_set'