问题描述:
在Colab中使用TPU读取数据时出现:UnimplementedError: File system scheme '[local]' not implemented
ignore_order = tf.data.Options()
if not ordered:
ignore_order.experimental_deterministic = False
dataset = tf.data.TFRecordDataset(filenames, num_parallel_reads=AUTO)
原因分析:
因为Colab TPU使用时会将数据放在GCS中,你要有GCS buckets才能有权限使用,解决方法有:
- 直接改成GPU使用
- 按照 GCS storage-buckets使用开通storage-buckets存储的服务
解决方案:
临时的,改为GPU
strategy = tf.distribute.MirroredStrategy()