nesl / nlp_adversarial_examples

Implementation code for the paper "Generating Natural Language Adversarial Examples"
MIT License
167 stars 49 forks source link

Segmentation fault in compute_dist_mat.py #2

Closed robinjia closed 5 years ago

robinjia commented 5 years ago

Hi,

I keep getting a segmentation fault when I run compute_dist_mat.py:

$ python compute_dist_mat.py 
Using TensorFlow backend.
Segmentation fault

All the previous steps in the README seem to complete without error. I've tried this on two different computers with python 2.7 and tensorflow 1.4 and 1.9, respectively. Any ideas on how to get around this? Or if someone could share the output of this script, that would also be appreciated. Thanks!

malzantot commented 5 years ago

Hi @robinjia ,

I have just been able to run the mentioned command without any trouble and generate the output file (using TF 1.8.0 and Python 3.6). I think the source of error may be due to the fact the output matrix is too large and may not fit into the memory of your machine (the output file size is ~20 GB), but this pre-computation would save a lot of time while generating the attack.

robinjia commented 5 years ago

Hi @malzantot,

Thanks for the reply! I got it working using python 3.6 :) I tried python3 before but I had gotten some other error, which I think was due to using the wrong version of GloVe vectors. You are right that I needed the larger memory machine as well.