asappresearch / sru

Training RNNs as Fast as CNNs (https://arxiv.org/abs/1709.02755)
MIT License
2.1k stars 306 forks source link

AttributeError when preprocessing data for DrQA #33

Closed mojesty closed 6 years ago

mojesty commented 6 years ago

Firstly i ran download.sh, and it succesfully downloaded glove and train/dev jsons for SQuAD. However, python prepro.py gave me this:

Traceback (most recent call last):
  File "prepro.py", line 243, in <module>
    vocab_tag = list(nlp.tagger.tag_names)
AttributeError: 'Tagger' object has no attribute 'tag_names'

My Spacy version is 2.0.3, and it seems like something broke in update from 1.x that is written in requirements, and I didn't succeed in fixing it myself. Any suggests?

taoleicn commented 6 years ago

Hi, The prepro.py code is taken from https://github.com/hitvoice/DrQA and the author is @hitvoice The required spacy version is 1.x according to the README.

@hitvoice any ideas?

hitvoice commented 6 years ago

prepro.py has been updated a month ago in https://github.com/hitvoice/DrQA. With spacy 2.0, the new script finishes without error, but it takes more than an hour to finish data processing (while with spacy 1.9 it takes only 70 seconds). I'm not able to find out what exactly is the problem and how to accelerate it even after following the "Migrating from spaCy 1.x" guide. Related issues in spacy: #1371 #1572, which are still open. I suggest sticking to spacy 1.9 until the spacy development team fixes related performance issues.

mojesty commented 6 years ago

Thanks @hitvoice . Do I need to update any other files to make it work with spaCy 2.x? I would like to use the same library version throughout my projects to avoid compatibility problems.

hitvoice commented 6 years ago

No, only "prepro.py".

xz-keg commented 6 years ago

@hitvoice when replacing the prepro.py with your new version, a new bug occurs.

Traceback (most recent call last): File "lib/python3.5/site-packages/cupy/cuda/stream.py", line 113, in del if self.ptr: AttributeError: 'Stream' object has no attribute 'ptr' if self.ptr: AttributeError: 'Stream' object has no attribute 'ptr'

I'd like to know how to deal with it... Many thanks...

mojesty commented 6 years ago

I used @hitvoice 's repo for the DrQa and it worked well, so consider this option also.

lenovopast17 commented 6 years ago

@aviczhl2 i think you should upgrade your NVIDIA driver, it worked for me.