cjlin1 / liblinear

LIBLINEAR -- A Library for Large Linear Classification
https://www.csie.ntu.edu.tw/~cjlin/liblinear/
BSD 3-Clause "New" or "Revised" License
1.01k stars 342 forks source link

Win7 python liblinear crash #51

Closed UCASREN closed 5 years ago

UCASREN commented 5 years ago

When I run the code below:

y, x = [3, 3, 3], [{0: 1, 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 11: 1, 12: 1}, {0: 1, 1: 1, 2: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 10: 1, 11: 1, 13: 1, 14: 1, 15: 1}, {5: 1, 7: 1, 8: 1, 10: 1, 11: 1, 13: 1, 14: 1, 16: 1, 17: 1, 18: 1, 19: 1, 20: 1, 21: 1}]
prob = problem(y, x)
param = parameter('-c 4')
m = train(prob, param)

I got (pycharm)python.exe crash

Traceback (most recent call last):
  File "D:/ProgramData/pycharm/workspace/Test/SlotFilling/main.py", line 95, in <module>
    model.fit()
  File "D:\ProgramData\pycharm\workspace\Test\SlotFilling\SVM.py", line 66, in fit
    m = train(prob, param)
  File "D:\ProgramData\Anaconda3\lib\site-packages\liblinearutil.py", line 155, in train
    m = liblinear.train(prob, param)
OSError: exception: access violation reading 0x00000C084B86D008

Why ? Pls help me, THANKS

cjlin1 commented 5 years ago

You shouldn't have 0:1 Feature index starts with 1

On 2019-04-16 02:05, UCASREN wrote:

When I run the code below:

y, x = [3, 3, 3], [{0: 1, 1: 1, 2: 1, 3: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 9: 1, 10: 1, 11: 1, 12: 1}, {0: 1, 1: 1, 2: 1, 4: 1, 5: 1, 6: 1, 7: 1, 8: 1, 10: 1, 11: 1, 13: 1, 14: 1, 15: 1}, {5: 1, 7: 1, 8: 1, 10: 1, 11: 1, 13: 1, 14: 1, 16: 1, 17: 1, 18: 1, 19: 1, 20: 1, 21: 1}] prob = problem(y, x) param = parameter('-c 4') m = train(prob, param)

I got (pycharm)python.exe crash

Traceback (most recent call last): File "D:/ProgramData/pycharm/workspace/Test/SlotFilling/main.py", line 95, in model.fit() File "D:\ProgramData\pycharm\workspace\Test\SlotFilling\SVM.py", line 66, in fit m = train(prob, param) File "D:\ProgramData\Anaconda3\lib\site-packages\liblinearutil.py", line 155, in train m = liblinear.train(prob, param) OSError: exception: access violation reading 0x00000C084B86D008

Why ? Pls help me, THANKS

-- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub [1], or mute the thread [2]. [ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/cjlin1/liblinear/issues/51", "url": "https://github.com/cjlin1/liblinear/issues/51", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]

Links:

[1] https://github.com/cjlin1/liblinear/issues/51 [2] https://github.com/notifications/unsubscribe-auth/ABI3BHQ5P3ZR3LWDQGVG2QDPQWJFVANCNFSM4HGG5EWQ

UCASREN commented 5 years ago

So thanks~