gpt4 book ai didi

Python 错误 : Unexpected end of data while reading a . tar 文件

转载 作者:太空宇宙 更新时间:2023-11-04 09:59:31 30 4
gpt4 key购买 nike

我正在尝试运行 TensorFlow 的 translate.py 文件,但几秒钟后我一直收到此错误:

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 文件可能会被代理服务器剥离/阻止,从而导致下载文件损坏。

关于Python 错误 : Unexpected end of data while reading a . tar 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44368599/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com