jamescalam / transformers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on import flair in "Sentiment with Flair"

shantimohan opened this issue · comments

I am getting the following error:

OSError                                   Traceback (most recent call last)
<ipython-input-1-911909092dfc> in <module>
----> 1 import flair
      2 model = flair.models.TextClassifier.load('en-sentiment')

C:\ProgramData\Anaconda3\envs\ml\lib\site-packages\flair\__init__.py in <module>
      1 import os
----> 2 import torch
      3 from pathlib import Path
      4 from transformers import set_seed as hf_set_seed
      5 

C:\ProgramData\Anaconda3\envs\ml\lib\site-packages\torch\__init__.py in <module>
    126                 err = ctypes.WinError(last_error)
    127                 err.strerror += f' Error loading "{dll}" or one of its dependencies.'
--> 128                 raise err
    129             elif res is not None:
    130                 is_loaded = True

OSError: [WinError 127] The specified procedure could not be found. Error loading "C:\ProgramData\Anaconda3\envs\ml\lib\site-packages\torch\lib\caffe2_detectron_ops.dll" or one of its dependencies.

The file C:\ProgramData\Anaconda3\envs\ml\lib\site-packages\torch\lib\caffe2_detectron_ops.dll is present in that directory.
I have flair 0.8 version.