使用Colab TPU时Tensorflow 2.5.0出错-NotFoundError:找不到元数据文件.[操作数据基



注意:这些相同的步骤在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]类似吗?不能使用TPU在Colab上使用自定义TFrecord数据集?

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

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]

我发现了这样的解释:

云TPU只能访问GCS中的数据,因为只有GCS文件系统已注册

更多信息请点击此处:文件系统方案';[本地]';未在Google Colab TPU 中实现

最新更新