tensorflow / nmt

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

TypeError: to_json() got an unexpected keyword argument 'indent' #383

Open ljch2018 opened 5 years ago

ljch2018 commented 5 years ago

I got this error, how can I fix it ?

 utils.save_hparams(out_dir, hparams)
  File "nmt/utils/misc_utils.py", line 119, in save_hparams
    f.write(hparams.to_json(indent=4, sort_keys=True))
TypeError: to_json() got an unexpected keyword argument 'indent

My tensorflow version is :

>>> tensorflow.__version__
'1.4.1'
dosonleung commented 5 years ago

somebody recommend to try tensorflow 1.5+

ghost commented 5 years ago

I just removed the parameters and atleast the code didn't throw an error at that point.

vikaskumarjha9 commented 5 years ago

I am getting the same error, I have tensorflow-gpu==1.4.1 and Cuda 8.0.61, installed. When running the sample run in the tutorial I am facing this issue.

vikaskumarjha9 commented 5 years ago

somebody recommend to try tensorflow 1.5+

It did not work out by using Tensorflow1.5+ since the cuda version 8 is not supported.

vikaskumarjha9 commented 5 years ago

I just removed the parameters and atleast the code didn't throw an error at that point.

This solution worked for me. I just removed both the parameters and trained one model, no issues whatsoever and training completed smoothly. Thank you for your reply and help.