【发布时间】: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