shentianxiao / language-style-transfer

Apache License 2.0
552 stars 135 forks source link

segmentation fault (core dumped) error #3

Open burtman opened 6 years ago

burtman commented 6 years ago

Hello,

Thanks for the amazing work, I've been trying to run your code with Python 2.7 and TensorFlow 1.5.

However, I have a segmentation fault (core dumped) error that stops the process. When using docker it only displays "Killed"

There is a similar issue here : https://github.com/tensorflow/tensorflow/issues/2034 But it does not seem to be related to this issue.

root@1234:path/language-style-transfer/code# python -V
Python 2.7.12
root@1234:path/language-style-transfer/code# python -c 'import tensorflow as tf; print(tf.__version__)'
/usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
1.5.0
root@1234:path/language-style-transfer/code# python style_transfer.py --train ../data/yelp/sentiment.train --dev ../data/yelp/sentiment.dev --output ../tmp/sentiment.dev --vocab ../tmp/yelp.vocab --model ../tmp/model
/usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
------------------------------------------------
{   'batch_size': 64,
    'beam': 1,
    'dev': '../data/yelp/sentiment.dev',
    'dim_emb': 100,
    'dim_y': 200,
    'dim_z': 500,
    'dropout_keep_prob': 0.5,
    'embedding': '',
    'filter_sizes': '3,4,5',
    'gamma_decay': 0.5,
    'gamma_init': 1,
    'gamma_min': 0.001,
    'learning_rate': 0.0001,
    'load_model': False,
    'max_epochs': 20,
    'max_seq_length': 20,
    'max_train_size': -1,
    'model': '../tmp/model',
    'n_filters': 128,
    'n_layers': 1,
    'online_testing': False,
    'output': '../tmp/sentiment.dev',
    'rho': 1,
    'steps_per_checkpoint': 1000,
    'test': '',
    'train': '../data/yelp/sentiment.train',
    'vocab': '../tmp/yelp.vocab'}
------------------------------------------------
#sents of training file 0: 179218
#sents of training file 1: 268041
vocabulary size: 9361
2018-01-29 17:55:38.668753: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2
Creating model with fresh parameters.
--------------------epoch 1--------------------
learning_rate: 0.0001   gamma: 1
Killed

Do you have any idea what's happening ?

shentianxiao commented 6 years ago

Can you run any other tensorflow code (say a tutorial)?

burtman commented 6 years ago

Hello @shentianxiao,

Thanks for your reply.

Yes I have been able to run the code examples in this repo without any issue (including autoencoders and Convolutional Neural Network) : https://github.com/aymericdamien/TensorFlow-Examples

shentianxiao commented 6 years ago

Can you run classifier.py and language_model.py in this repo? The commands are:

python classifier.py --train ../data/yelp/sentiment.train --dev ../data/yelp/sentiment.dev --vocab ../tmp/yelp.vocab --model ../tmp/model.cls
python language_model.py --train ../data/yelp/sentiment.train.0 --dev ../data/yelp/sentiment.dev.0 --vocab ../tmp/yelp.vocab --model ../tmp/model.lm
burtman commented 6 years ago

Yes both of these commands work perfectly !

shentianxiao commented 6 years ago

Can you run the testing command (with randomly initialized model, but yelp.vocab is required):

python style_transfer.py --test ../data/yelp/sentiment.test --output ../tmp/sentiment.test --vocab ../tmp/yelp.vocab

I haven't encountered this problem before, and the error message doesn't have much information. Are you using the CPU version? That might be a difference, but I'm not sure what's the problem there.

burtman commented 6 years ago

Hello,

I think that's where the problem is coming from. I am indeed using the CPU version. This command is not running (or is so slow that I see nothing happening ...).

Is there a way to make it work with the CPU version or is the GPU mandatory ?

shentianxiao commented 6 years ago

Hi,

Unfortunately I think a GPU is necessary to train a model...

I just uploaded a pretrained model (see the readme file and run download_model.sh), you can try it on a small test file (keep a few sentences). I think that should be able to run out.