numpy version error
qibinc opened this issue · comments
Qibin Chen commented
When running interactive with numpy==1.16.3
, I encountered the following error.
It seems the .npz
file must be loaded with numpy version <=1.16.2
. When I installed numpy==1.16.2, the problem is gone.
Please update requirements.txt
or update the data/wikipedia/docs-tfidf-ngram=2-hash=16777216-tokenizer=simple.npz
file
➜ python scripts/pipeline/interactive.py
12/01/2019 04:38:39 PM: [ CUDA enabled (GPU -1) ]
12/01/2019 04:38:39 PM: [ Initializing pipeline... ]
12/01/2019 04:38:39 PM: [ Initializing document ranker... ]
12/01/2019 04:38:39 PM: [ Loading /home/qibin/DrQA/data/wikipedia/docs-tfidf-ngram=2-hash=16777216-tokenizer
=simple.npz ]
Traceback (most recent call last):
File "scripts/pipeline/interactive.py", line 70, in <module>
tokenizer=args.tokenizer
File "/home/qibin/DrQA/drqa/pipeline/drqa.py", line 109, in __init__
self.ranker = ranker_class(**ranker_opts)
File "/home/qibin/DrQA/drqa/retriever/tfidf_doc_ranker.py", line 37, in __init__
matrix, metadata = utils.load_sparse_csr(tfidf_path)
File "/home/qibin/DrQA/drqa/retriever/utils.py", line 36, in load_sparse_csr
return matrix, loader['metadata'].item(0) if 'metadata' in loader else None
File "/data/qibin/anaconda3/envs/alchemy/lib/python3.6/_collections_abc.py", line 666, in __contains__
self[key]
File "/data/qibin/anaconda3/envs/alchemy/lib/python3.6/site-packages/numpy/lib/npyio.py", line 262, in __g
etitem__
pickle_kwargs=self.pickle_kwargs)
File "/data/qibin/anaconda3/envs/alchemy/lib/python3.6/site-packages/numpy/lib/format.py", line 692, in re
ad_array
raise ValueError("Object arrays cannot be loaded when "
ValueError: Object arrays cannot be loaded when allow_pickle=False
Ethan Perez commented
Got the same error with numpy==1.16.4
. pip install numpy==1.16.2
fixed it for me, thanks!