facebookresearch / pytext

A natural language modeling framework based on PyTorch
https://pytext.readthedocs.io/en/master/
Other
6.34k stars 800 forks source link

Segmentation fault: 11 #1365

Open salkola opened 4 years ago

salkola commented 4 years ago

Following the installation directions

$ python3 -m venv pytext_venv
$ source pytext_venv/bin/activate
(pytext_venv) $ pip install pytext-nlp

gives a segmentation fault when training a PyText model. For example, when I train a model for the clinical trial parser project using a command

pytext train < src/resources/config/ner.json

it fails with:

Worker 0 starting epoch 1
Learning rate(s): 0.001
start training epoch 1
Segmentation fault: 11

The segmentation fault disappears when I install PyText using Anaconda3 and upgrading onnx and torch to their latest versions.

randywang123 commented 4 years ago

@salkola Thanks for pointing that question out. I have the same segmentation fault. However, the upgrading onnx and torch solution doesn't work on my anaconda environment. The latest version of torch is 1.5.1 but the requirement for pytext is 1.5.0. I was using the same command as you mentioned in the related issue but pip install pytext-nlp would remove everything that is not compatible with the requirement.

Some important configuration are shown as below:

Package                            Version
---------------------------------- -------------------
torch                              1.5.0
onnx                               1.7.0
click                              7.1.2
fairseq                            0.9.0
future                             0.18.2
fvcore                             0.1.1.post20200608
hypothesis                         3.88.3
joblib                             0.15.1
numpy                              1.18.5
python-dateutil                    2.8.0
pandas                             1.0.4
pytorch-dp                         0.1b1
pytorch-pretrained-bert            0.6.2
regex                              2019.11.1
requests                           2.23.0
scipy                              1.4.1
sentencepiece                      0.1.92
tensorboard                        1.14.0
torchtext                          0.6.0