Open gwen10nnyson opened 5 years ago
The code is written in Python 2.7. Thanks!
Yes, I understand. but is there any way it can work on python 3.5? because I am using windows and tensorflow is not supported on python 2.7
For future reference, this model is largely compatible with python 3. You just have to change all of the calls to open(...,'wb') to open(...,'w'), as you are not writing bytes to the files. Alternatively, encode strings as bytes before writing them.
Also, as the MosesTokenizer is no longer included in nltk, you should separately install the sacremoses package, which is the same.
Traceback (most recent call last): File "ptb-utt.py", line 155, in
main(config)
File "ptb-utt.py", line 97, in main
prepare_dirs_loggers(config, os.path.basename(file))
File "C:\Users\hw\NeuralDialog-LAED-master\laed\utils.py", line 105, in prepare_dirs_loggers
json.dump(config.dict, fp, indent=4, sort_keys=True)
File "C:\Users\hw\Anaconda3\envs\py35\lib\json__init__.py", line 179, in dump
fp.write(chunk)
TypeError: a bytes-like object is required, not 'str'