Closed imgarylai closed 5 years ago
I don't know if this was caused by this patch.
>>> import mxnet as mx
>>> from elit.nlp.dep.parser.parser import BiaffineParser
>>> path = '/home/hhe43/elit/data/model/dep/jumbo-fasttext100'
>>> parser = BiaffineParser(context=mx.gpu(0))
>>> parser.load(path)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/glai2/elit/elit/nlp/dep/parser/parser.py", line 166, in load
self._vocab = ParserVocabulary.load(self._config.save_vocab_path)
File "/home/glai2/elit/elit/nlp/dep/common/savable.py", line 31, in load
return pickle.load(f)
ModuleNotFoundError: No module named 'elit.dep'
>>>
No, the model class was in 'elit.dep'
, after moving away, pickle complaints this. Let me try to make a new pickle file.
I've just updated elit/data/model/dep/jumbo-fasttext100
in my home path. Please try it.
Data has been updated.
https://github.com/elitcloud/elit/blob/c8fc984e926e957e21093a44d04096a0e14db9bc/elit/nlp/dep/parser/parser.py#L165
self._config.save_vocab_path
is specified as a relative path in the config path. However, it causes problem if resources file are not in the same directory.