我試圖運行TensorFlow的translate.py文件,但已經幾秒鐘後,我不斷收到此錯誤:Python的錯誤:數據意外結束而讀.tar文件
tarfile.ReadError: unexpected end of data
我沒有想法爲什麼發生這種情況,我嘗試了幾件事,包括自己下載所需的數據,並在下載代碼中註釋該行,但沒有任何工作。
這裏是我按照網站: https://www.tensorflow.org/tutorials/seq2seq
以防萬一你需要的一切,這裏是從命令到錯誤的線:
C:\Users\Mueller>python translate.py
Preparing WMT data in /tmp
Extracting tar file /tmp\training-giga-fren.tar
Traceback (most recent call last):
File "translate.py", line 322, in <module>
tf.app.run()
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\site-package
s\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "translate.py", line 319, in main
train()
File "translate.py", line 173, in train
FLAGS.data_dir, FLAGS.from_vocab_size, FLAGS.to_vocab_size)
File "C:\Users\Mueller\data_utils.py", line 267, in prepare_wmt_data
train_path = get_wmt_enfr_train_set(data_dir)
File "C:\Users\Mueller\data_utils.py", line 83, in get_wmt_enfr_train_set
corpus_tar.extractall(directory)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 1996, in extractall
numeric_owner=numeric_owner)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 2038, in extract
numeric_owner=numeric_owner)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 2108, in _extract_member
self.makefile(tarinfo, targetpath)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 2156, in makefile
copyfileobj(source, target, tarinfo.size, ReadError)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 243, in copyfileobj
raise exception("unexpected end of data")
tarfile.ReadError: unexpected end of data
有誰知道發生了什麼這裏?
你的tar文件似乎不完整 - 可能是由於'/ tmp'中缺少磁盤空間? –
確實有足夠的記憶,我剛剛檢查過它。 – AlexM