リンク:https://www.tensorflow.org/tutorials/images/transfer_learning
(raw_train, raw_validation, raw_test), metadata = tfds.load( 'cats_vs_dogs', split=['train[:80%]', 'train[80%:90%]', 'train[90%:]'], with_info=True, as_supervised=True, )
エラーが発生する理由
KeyError: "Invalid split train[:80%]. Available splits are: ['train']"
このコードを試してください。次のようにTF 2で分割できます。
(raw_train, raw_validation, raw_test), metadata = tfds.load(
'cats_vs_dogs',
split=[
tfds.Split.TRAIN.subsplit(tfds.percent[:80]),
tfds.Split.TRAIN.subsplit(tfds.percent[80:90]),
tfds.Split.TRAIN.subsplit(tfds.percent[90:])
],
with_info=True,
as_supervised=True,
)