【问题标题】:Error when downloading zip file TensorFlow Keras下载 zip 文件时出错 TensorFlow Keras
【发布时间】:2021-04-21 11:52:37
【问题描述】:

我一直在关注 tensorflow 的机器翻译教程:Neural machine translation with attention

我想在 Japanes to English dataset 上使用相同的代码,但它引发了以下错误:

当我尝试使用浏览器下载文件时,它可以正常运行。

我的代码:

# Download the file
path_to_zip = tf.keras.utils.get_file(
    'jpn-eng.zip', origin='http://www.manythings.org/anki/jpn-eng.zip', extract=True)

path_to_file = os.path.dirname(path_to_zip)+"/jpn-eng/jpn.txt"

【问题讨论】:

  • 网站 www.manythings.org 似乎拒绝了tf.keras.utils.get_file 的请求,可能是由于 HTTP 请求头信息不满足最小信息,您可以通过先下载文件来解决它(例如 @ 987654327@ 和 !unzip jpn-eng.zip) 然后加载它

标签: python tensorflow tensorflow2.0 tf.keras machine-translation


【解决方案1】:

来自 cmets

网站www.manythings.org好像拒绝了 tf.keras.utils.get_file 可能是由于 HTTP 请求头信息不是 满足最少信息,您可以通过下载文件来解决它 首先(例如 !wget http://www.manythings.org/anki/jpn-eng.zip 和 !unzip jpn-eng.zip) 然后加载它。 (转述自如先生)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-27
    • 1970-01-01
    相关资源
    最近更新 更多