Char-RNN-TensorFlow icon indicating copy to clipboard operation
Char-RNN-TensorFlow copied to clipboard

when test "sample.py", there is a error report raised

Open hncshp opened this issue 8 years ago • 6 comments

File "C:/Users/HP/PycharmProjects/CharRnn/sample.py", line 20, in main FLAGS.start_string = FLAGS.start_string.decode('utf-8') AttributeError: 'str' object has no attribute 'decode'

hncshp avatar Dec 18 '17 02:12 hncshp

Please use this code in Python2.7

hzy46 avatar Dec 18 '17 04:12 hzy46

what if i use Python3, how to fix?

hncshp avatar Dec 18 '17 05:12 hncshp

Delect all the decode('utf-8') and encode('utf-8') in this code. Because python3 handles string in a different manner, I'm not sure whether it will work properly.

hzy46 avatar Dec 18 '17 08:12 hzy46

you can try to delete that sentence.I have a try,then it can work correctly,although I don not know why the reason.

lerenhua avatar Dec 27 '17 12:12 lerenhua

delete,well done

zkailinzhang avatar May 09 '18 16:05 zkailinzhang

just instead with:

FLAGS.start_string = FLAGS.start_string.encode('utf-8').decode('utf-8')

A11en0 avatar Sep 24 '20 11:09 A11en0