tensorflow / nmt

TensorFlow Neural Machine Translation Tutorial
Apache License 2.0
6.39k stars 1.96k forks source link

Need the NMT (Seq2Seq) TensorFlow Translation Model for English to French and vice versa #217

Open frajos100 opened 6 years ago

frajos100 commented 6 years ago

Need the NMT (Seq2Seq) TensorFlow Translation Model for English to French and vice versa. How do i get the Model so that i would be able to add on to it as per the requirement of the project,

nbro commented 6 years ago

@frajos100 What do you mean by "I need ... the model". Do you need a trained model?

frajos100 commented 6 years ago

Hi, We are trying to implement the model for English to French and French to English translation for us to be able to add translation for specific words in English and French.

Had installed the tensorflow using the below command that I had got from the linkhttps://github.com/tensorflow/tensorflow#installation . pip install tf-nightly

After cloning the git repositoryhttps://github.com/tensorflow/models in Windows Server 2016 as per linkhttps://www.tensorflow.org/versions/r1.0/tutorials/seq2seq was trying to get the English to French data model setup on the server by running the following command python translate.py --data_dir model

It ran for 4 hours and collected 17.4 GB data. After that it crashed with the below error. Need your help to understand what I am doing wrong?. [cid:image001.png@01D38AC7.39BABA20] 2018-01-10 14:20:52.146820: I C:\tf_jenkins\workspace\tf-nightly-windows\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2 Creating 3 layers of 1024 units. WARNING:tensorflow:From C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\ops\nn_impl.py:1310: softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version. Instructions for updating:

Future major versions of TensorFlow will allow gradients to flow into the labels input on backprop by default.

See tf.nn.softmax_cross_entropy_with_logits_v2.

Traceback (most recent call last): File "translate.py", line 322, in tf.app.run() File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\platform\app.py", line 124, in run _sys.exit(main(argv)) File "translate.py", line 319, in main train() File "translate.py", line 178, in train model = create_model(sess, False) File "translate.py", line 136, in create_model dtype=dtype) File "C:\Users\atladmin\AppData\Local\Accenture\TensorFlow\models-master\tutorials\rnn\translate\seq2seq_model.py", line 179, in init softmax_loss_function=softmax_loss_function) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\contrib\legacy_seq2seq\python\ops\seq2seq.py", line 1209, in model_with_buckets decoder_inputs[:bucket[1]]) File "C:\Users\atladmin\AppData\Local\Accenture\TensorFlow\models-master\tutorials\rnn\translate\seq2seq_model.py", line 178, in lambda x, y: seq2seq_f(x, y, False), File "C:\Users\atladmin\AppData\Local\Accenture\TensorFlow\models-master\tutorials\rnn\translate\seq2seq_model.py", line 142, in seq2seq_f dtype=dtype) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\contrib\legacy_seq2seq\python\ops\seq2seq.py", line 851, in embedding_attention_seq2seq encoder_cell = copy.deepcopy(cell) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 161, in deepcopy y = copier(memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow\python\layers\base.py", line 791, in deepcopy setattr(result, k, copy.deepcopy(v, memo)) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 150, in deepcopy y = copier(x, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 215, in _deepcopy_list append(deepcopy(a, memo)) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 150, in deepcopy y = copier(x, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 150, in deepcopy y = copier(x, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 150, in deepcopy y = copier(x, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 150, in deepcopy y = copier(x, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Users\atladmin\AppData\Local\Programs\Python\Python36\lib\copy.py", line 169, in deepcopy rv = reductor(4) TypeError: can't pickle _thread.lock objects

Thanks and Regards,

Francisco Fernandes

frajos100 commented 6 years ago

Hence planning to use the NMT with the trained English to French and French to English Model. Is there a way the English to French Translation model used in https://github.com/tensorflow/models can be imported in this model?

oahziur commented 6 years ago

@frajos100 I don't think there is a way to import checkpoints saved by https://github.com/tensorflow/models

frajos100 commented 6 years ago

Its ok. Is there any Tensorflow model for English To French and French to English translation where the user can retrain the model to recognize and provide translation for some Financial related words as per the training.