0
我正試圖獲得了低於tf.gfile.Glob無論如何給我UnicodeDecodeError錯誤來解決這個問題?
dir_list = tf.gfile.Glob(engine.TXT_DIR+"/*.txt")
但是寫在韓國指定的目錄中的代碼txt文件的名稱列表,此人給我下面的錯誤:
Traceback (most recent call last):
File "D:/Prj_mayDay/Prj_FrankenShtine/shakespear_reborn/main.py", line 108, in <module>
dir_list = tf.gfile.Glob(engine.TXT_DIR+"/*.txt")
File "D:\KimKanna's Class\python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 326, in get_matching_files
compat.as_bytes(filename), status)
File "D:\KimKanna's Class\python35\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 325, in <listcomp>
for matching_filename in pywrap_tensorflow.GetMatchingFiles(
File "D:\KimKanna's Class\python35\lib\site-packages\tensorflow\python\util\compat.py", line 106, in as_str_any
return as_str(value)
File "D:\KimKanna's Class\python35\lib\site-packages\tensorflow\python\util\compat.py", line 84, in as_text
return bytes_or_text.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 19: invalid start byte
現在,整個一些研究,我發現了reason
The error is because there is some non-ascii character in the dictionary and it can't be encoded/decoded
不過,我沒有看到任何方式應用解決方案到我的代碼中或者有嗎?
**如果有替代的代碼。它應該適用於雲存儲桶/我的個人硬盤,如上面的代碼所做的那樣。
我使用python3,1.2.0-RC2