erre-quadro / spikex

SpikeX - SpaCy Pipes for Knowledge Extraction
Apache License 2.0
398 stars 28 forks source link

Exception: invalid data, magic number is not correct #5

Open ghost opened 3 years ago

ghost commented 3 years ago

Description

Hi i installed spikex and downloaded enwiki_core. However when i try to load enwiki_core :

from spikex.wikigraph import load as wg_load
from spikex.pipes import WikiPageX

# load a WikiGraph
wg = wg_load('enwiki_core')

I am getting the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\local\Pathways\nicepaths\lib\site-packages\spikex\wikigraph\wikigraph.py", line 41, in load
    return WikiGraph.load(data_path, meta)
  File "C:\local\Pathways\nicepaths\lib\site-packages\spikex\wikigraph\wikigraph.py", line 81, in load
    wg._wpd = WikiPageDetector.load(data_path)
  File "C:\local\Pathways\nicepaths\lib\site-packages\spikex\wikigraph\wikigraph.py", line 180, in load
    wpd._trie = Trie.from_buff(mmap(bf.fileno(), 0), copy=False)
  File "lib\cyac\trie.pyx", line 1086, in cyac.trie.Trie.from_buff
  File "lib\cyac\trie.pyx", line 1103, in cyac.trie.trie_from_buff
Exception: invalid data, magic number is not correct

cyac version is 1.3 (last one) Any ideas please?

chenkovsky commented 3 years ago

how was 'enwiki_core' built? maybe it's built by old version cyac.

chenkovsky commented 3 years ago

there is a bug, in from_buff of old version cyac.

paoloq commented 3 years ago

@MLAlex1, a new _enwikicore version has been released. Could you please try to see if that error happens again?

callumhedemann commented 2 years ago

Hi I am getting the exact same error - I have tried with the latest enwiki_core and also built my own enwiki_core using the spikex create-wikigraph command.

cyac version 1.4, cython version 0.29.28, python version 3.7.3, Spacy version 3.2.3 spikex version 0.5.2

Edit: A fresh venv with only the above libraries fixed the problem