gpt4 book ai didi

python - key 错误 : "Invalid split train[:80%]. Available splits are: [' train']"

转载 作者:行者123 更新时间:2023-12-03 18:43:55 27 4
gpt4 key购买 nike

Link: 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=真,
as_supervised=真,
)

为什么会出错

KeyError: "无效的拆分火车[:80%]。可用拆分为:['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,
)

关于python - key 错误 : "Invalid split train[:80%]. Available splits are: [' train']",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59959438/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com