Issue.:
2020-01-27 14:15:54,846 loading file C:\Users\1025289.flair\models\en-pos-ontonotes-fast-v0.4.pt
Traceback (most recent call last):
File ".\fmain.py", line 16, in
main()
File ".\fmain.py", line 4, in main
intent_obj = GET_INTENT(b_preprocess_query=True)
File "C:\work\python\proj_fai\get_intent.py", line 10, in __init__
super().__init__(b_preprocess_query=b_preprocess_query)
File "C:\work\python\proj_fai\model_flair.py", line 24, in __init__
self._load_flair_model(flair_model)
File "C:\work\python\proj_fai\model_flair.py", line 30, in _load_flair_model
self._seq_tag = SequenceTagger.load(flair_model)
File "C:\Users\1025289\AppData\Local\Programs\Python\Python37lib\site-packagesflair\nn.py", line 88, in load
model = cls._init_model_with_state_dict(state)
File "C:\Users\1025289\AppData\Local\Programs\Python\Python37lib\site-packagesflair\models\sequence_tagger_model.py", line 273, in _init_model_with_state_dict
loss_weights=weights,
File "C:\Users\1025289\AppData\Local\Programs\Python\Python37lib\site-packagesflair\models\sequence_tagger_model.py", line 217, in __init__
self.to(flair.device)
File "C:\Users\1025289\AppData\Local\Programs\Python\Python37lib\site-packagestorch\nn\modules\module.py", line 425, in to
return self._apply(convert)
File "C:\Users\1025289\AppData\Local\Programs\Python\Python37lib\site-packagestorch\nn\modules\module.py", line 201, in _apply
module._apply(fn)
File "C:\Users\1025289\AppData\Local\Programs\Python\Python37lib\site-packagestorch\nn\modules\module.py", line 201, in _apply
module._apply(fn)
File "C:\Users\1025289\AppData\Local\Programs\Python\Python37lib\site-packagestorch\nn\modules\module.py", line 201, in _apply
module._apply(fn)
File "C:\Users\1025289\AppData\Local\Programs\Python\Python37lib\site-packagesflair\models\language_model.py", line 394, in _apply
for info in torch.__version__.split('.'))
File "C:\Users\1025289\AppData\Local\Programs\Python\Python37lib\site-packagesflair\models\language_model.py", line 394, in
for info in torch.__version__.split('.'))
ValueError: invalid literal for int() with base 10: '0+cpu'
Environment.:
python : 3.76
torch 1.40
Bug as follows:
for info in torch.__version__.split('.'))
ValueError: invalid literal for int() with base 10: '0+cpu'
torch.__version__.split('.') returns below list but it is trying to convert 0+cpu to int which is raising error.
['1', '4', '0+cpu']
Issue in file.:
flair\models\language_model.py
def _apply(self, fn):
major, minor, build, *_ = (int(info)
for info in torch.__version__.split('.'))
the same problem here any help please
Same problem. I don't have a gpu.
any work around?
currently I am trying to setup CUDA hope it will work
Hi all, @mittalsuraj18 did a PR that should fix this. The PR has just been merged. Could you try installing with:
pip install --upgrade git+https://github.com/flairNLP/flair.git
Instead of the normal pip install. This should fix the error.
@alanakbik and @mittalsuraj18 thank you it is working now appreciated.
It's working for me too. Thanks guys!
@alanakbik i think we can close this issue now
Sure you can close this issue
On Fri 31 Jan, 2020, 11:49 PM Suraj Mittal, notifications@github.com
wrote:
@alanakbik https://github.com/alanakbik i think we can close this issue
now—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/flairNLP/flair/issues/1388?email_source=notifications&email_token=AASOEU7LEXLOJHARFVBLAYDRARTSZA5CNFSM4KL5TLF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKPQ32I#issuecomment-580849129,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AASOEU5VC3VJF2P7WKBJTHTRARTSZANCNFSM4KL5TLFQ
.
Same problem here, but using GPU.
In my enviroment i've used this version of torch:
pip install torch==1.4.0+cu100 torchvision==0.5.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html
Then, the error was:
ValueError: invalid literal for int() with base 10: '0+cu100' | for info in torch.__version__.split('.'))
I've locally edited language_model.py to simply replace the "cu100" string and solved the problem.
I'm not sure what is the best solution to commit, because probably for other users the string can be different from "cu100".
Hi @kunkaweb, @mittalsuraj18 (thanks!!) did another PR that should fix this. Could you try installing with:
pip install --upgrade git+https://github.com/flairNLP/flair.git
Instead of the normal pip install. This should fix the error.
I can add that this solved the issue for me, although my string is slightly different: 0+cu92 instead of 0+cpu
@Melothe glad to hear it
Most helpful comment
Hi all, @mittalsuraj18 did a PR that should fix this. The PR has just been merged. Could you try installing with:
Instead of the normal pip install. This should fix the error.