AttributeError: Numpy object 'NpzFile' has no 'zip' attribute?

0

I tried to download DrQA , a reading comprehension system applied to open domain questions developed by the Facebook research group. It included asking for the trained models provided and the data for the answer to questions from Wikipedia. However, when I tried to start the interactive session, this AttributeError appeared:

(drqa_env) mike@mike-thinks:~/Programing/DrQA$ python scripts/pipeline/interactive.py
07/16/2018 11:38:35 PM: [ Running on CPU only. ]
07/16/2018 11:38:35 PM: [ Initializing pipeline... ]
07/16/2018 11:38:35 PM: [ Initializing document ranker... ]
07/16/2018 11:38:35 PM: [ Loading /home/mike/Programing/DrQA/data/wikipedia/docs-tfidf-ngram=2-hash=16777216-tokenizer=simple.npz ]
Traceback (most recent call last):
  File "scripts/pipeline/interactive.py", line 83, in <module>
    tokenizer=args.tokenizer
  File "/home/mike/Programing/DrQA/drqa/pipeline/drqa.py", line 109, in __init__
    self.ranker = ranker_class(**ranker_opts)
  File "/home/mike/Programing/DrQA/drqa/retriever/tfidf_doc_ranker.py", line 37, in __init__
    matrix, metadata = utils.load_sparse_csr(tfidf_path)
  File "/home/mike/Programing/DrQA/drqa/retriever/utils.py", line 33, in load_sparse_csr
    loader = np.load(filename)
  File "/home/mike/Programing/drqa_env/lib/python3.6/site-packages/numpy/lib/npyio.py", line 414, in load
    pickle_kwargs=pickle_kwargs)
  File "/home/mike/Programing/drqa_env/lib/python3.6/site-packages/numpy/lib/npyio.py", line 173, in __init__
    _zip = zipfile_factory(fid)
  File "/home/mike/Programing/drqa_env/lib/python3.6/site-packages/numpy/lib/npyio.py", line 103, in zipfile_factory
    return zipfile.ZipFile(file, *args, **kwargs)
  File "/usr/lib/python3.6/zipfile.py", line 1108, in __init__
    self._RealGetContents()
  File "/usr/lib/python3.6/zipfile.py", line 1175, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file
Exception ignored in: <bound method NpzFile.__del__ of <numpy.lib.npyio.NpzFile object at 0x7fa18140e9e8>>
Traceback (most recent call last):
  File "/home/mike/Programing/drqa_env/lib/python3.6/site-packages/numpy/lib/npyio.py", line 210, in __del__
    self.close()
  File "/home/mike/Programing/drqa_env/lib/python3.6/site-packages/numpy/lib/npyio.py", line 201, in close
    if self.zip is not None:
AttributeError: 'NpzFile' object has no attribute 'zip'

It seems to mean that the Numpy object does not have any zip attributes. I think he tried to unzip the model file but he does not have the right tools.

Do you know how to cope? I already had a problem with this repository while downloading its repository of large, trained models that I'm talking about in a GitHub problem .

Is it possible that you have a damaged file? It seems that the problem is that the zipfile module can not unzip it (and then NumPy's error handling is not as beautiful as it could be). But, what file should I apply unzip -t of its shell and verify that it is valid?

    
asked by ThePassenger 17.07.2018 в 03:38
source

0 answers