【问题标题】:Error in Tensorflow 2.5.0 while using Colab TPU - NotFoundError: Could not find metadata file. [Op.DatasetCardinality]使用 Colab TPU 时 Tensorflow 2.5.0 出错 - NotFoundError:找不到元数据文件。 [Op.DatasetCardinality]
【发布时间】:2021-10-11 16:39:53
【问题描述】:

注意:这些相同的步骤在 Colab GPU 上运行没有任何错误。

请帮我解决这个问题。我创建了一个数据集并将其保存为文件

data = tf.data.Dataset.from_tensor_slices(( features, labels))
tf.data.experimental.save(data, myfile)

当我尝试加载它时

data = tf.data.experimental.load(myfile)

然后对len(data)data.batch(16)data.take(1) 等数据运行任何函数,然后我会收到此错误:

NotFoundError: Could not find metadata file. [Op:DatasetCardinality]

TPU 配置

resolver = tf.distribute.cluster_resolver.TPUClusterResolver(tpu='')
tf.config.experimental_connect_to_cluster(resolver)
# This is the TPU initialization code that has to be at the beginning.
tf.tpu.experimental.initialize_tpu_system(resolver)

和这个TF1.14][TPU]Can not use custom TFrecord dataset on Colab using TPU类似吗?

【问题讨论】:

    标签: python tensorflow google-colaboratory tpu


    【解决方案1】:

    经过更多调试后,我得到了这个错误:

    UnimplementedError: File system scheme '[local]' not implemented (file: './data/temp/2692738424590406024')
        Encountered when executing an operation using EagerExecutor. This error cancels all future operations and poisons their output tensors. [Op:DatasetCardinality]
    

    我找到了这个解释:

    Cloud TPU 只能访问 GCS 中的数据,因为只注册了 GCS 文件系统。

    更多信息在这里:File system scheme '[local]' not implemented in Google Colab TPU

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-06
      • 2021-10-19
      • 2020-02-02
      • 2021-10-05
      • 1970-01-01
      • 2019-11-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多