Unable to load model from Python, while OK from the CLI.
Hi all,
I am trying to load a model from Python and it yields the following error :
>>> import crfsuite
>>> t = crfsuite.Tagger()
>>> t.open("/.../my.crf.model")
Assertion failed: (false), function crf1dm_initialize_header, file /SourceCache/CRFSuite/CRFSuite-33/crfsuite/lib/crf/src/crf1d_model.c, line 990.
Abort trap: 6
The strange thing is that the same model works perfectly when loaded from the CLI :
crfsuite tag -m /.../my.crf.model test.txt
I have tried to reinstall swig, but it does not change anything. Any clue of what I should try next ?
Thanks in advance and Happy New Year !
Have you solved it?
Pitifully not... I switched to an ubuntu-based VM, but I would be happy to know if you make any progress.
Me too. Tried to work around it for several hours but with no success. The python binding for CRFsuite works under linux, but has very strange problems on a Mac. It says assertion failed, but I cannot even find the line of assertion in the code.
On May 6, 2013, at 8:33 AM, Antoine DURIEUX [email protected] wrote:
Pitifully not... I switched to an ubuntu-based VM, but I would be happy to know if you make any progress.
— Reply to this email directly or view it on GitHub.
Just to potentially mark this as "solved": The confusion/problem arises because OSX comes with its own CRF Suite installed (in /usr/lib/libCRFSuite.dylib), and that Apple-hacked version does have said assertion, explaining why you guys are not finding it. (EDIT: I assume, that is...)
So if you are getting this error on a Mac, your dependent binary (e.g., Python wrapper for CRF Suite, NER Suite - which wraps CRF Suite, etc.) is compiled against the wrong dynamic library (the one by Apple just mentioned, instead of whatever you installed). To check if that is the case, use otool -L /path/to/your/binary and see which CRF Suite library it is linked to. If it is the one quoted above, your binary is linked to the wrong target.
@fnl , thank you very much! That was the case. Just wondering why there is a pre-installed CRFSuite in OSX...