lvapeab / nmt-keras

Neural Machine Translation with Keras
http://nmt-keras.readthedocs.io
MIT License
533 stars 130 forks source link

training wrong ('bash' is not an internal or external command,) #101

Closed RookieCXL closed 5 years ago

RookieCXL commented 5 years ago

When I training the model,something wrong happen. Maybe because I use windows ,‘bash’ can't use? Could you help me?


Epoch 1/500 198/198 [==============================] - 22s 110ms/step - loss: 6.4606

[10/04/2019 13:00:53] <<< Saving model to trained_models/EuTrans_esen_AttentionRNNEncoderDecoder_src_emb_32_bidir_True_enc_LSTM_32_dec_ConditionalLSTM_32_deepout_linear_trg_emb_32_Adam_0.001//epoch_1 ... >>> c:\users\think\src\keras\keras\engine\saving.py:128: UserWarning: TensorFlow optimizers do not make it possible to access optimizer attributes or optimizer state after instantiation. As a result, we cannot save the optimizer as part of the model save file.You will have to compile your model again after loading it. Prefer using a Keras optimizer instead (see keras.io/optimizers). 'TensorFlow optimizers do not ' [10/04/2019 13:00:54] <<< Model saved >>>

[10/04/2019 13:00:54] <<< Predicting outputs of val set >>> Sampling 100/100 - ETA: 0s Total cost of the translations: 855.539402 Average cost of the translations: 8.555394 The sampling took: 7.042696 secs (Speed: 0.070427 sec/sample)

[10/04/2019 13:01:01] Prediction output 0: target_text (text) [10/04/2019 13:01:01] Decoding beam search prediction ... [10/04/2019 13:01:01] Using heuristic 0 [10/04/2019 13:01:01] Evaluating on metric coco 'bash' is not an internal or external command, nor is it a runnable program Or batch file. 'rm' is not an internal or external command, nor is it a runnable program Or batch file.

Traceback (most recent call last): File "main.py", line 49, in train_model(parameters, args.dataset) File "C:\Users\think\Desktop\nmt-keras-master\nmt_keras\training.py", line 162, in train_model nmt_model.trainNet(dataset, training_params) File "c:\users\think\src\keras-wrapper\keras_wrapper\cnn_model.py", line 915, in trainNet self.train(ds, params) File "c:\users\think\src\keras-wrapper\keras_wrapper\cnn_model.py", line 1143, in train initial_epoch=params['epoch_offset']) File "c:\users\think\src\keras\keras\legacy\interfaces.py", line 91, in wrapper return func(*args, **kwargs) File "c:\users\think\src\keras\keras\engine\training.py", line 1504, in fit_generator initial_epoch=initial_epoch) File "c:\users\think\src\keras\keras\engine\training_generator.py", line 255, in fit_generator callbacks.on_epoch_end(epoch, epoch_logs) File "c:\users\think\src\keras\keras\callbacks.py", line 152, in on_epoch_end callback.on_epoch_end(epoch, logs) File "c:\users\think\src\keras-wrapper\keras_wrapper\extra\callbacks.py", line 280, in on_epoch_end self.evaluate(epoch, counter_name='epoch') File "c:\users\think\src\keras-wrapper\keras_wrapper\extra\callbacks.py", line 513, in evaluate split=s) File "c:\users\think\src\keras-wrapper\keras_wrapper\extra\evaluation.py", line 61, in get_cocoscore score, = scorer.compute_score(refs, hypo) File "c:\users\think\src\coco-caption\pycocoevalcap\ter\ter.py", line 63, in compute_score return float(score), None ValueError: could not convert string to float:

lvapeab commented 5 years ago

Hi,

it seems that the computation of TER and METEOR (which are wrappers around java) doesn't work in Windows. Those are not required for running the program. As a bypass, you can edit your file c:\users\think\src\keras-wrapper\keras_wrapper\extra\evaluation.py and comment the Line 51 and the Lines 55-56.

I hope this works.

RookieCXL commented 5 years ago

Thanks,It works.