ValueError:生成器的输出应该是元组`(x,y,sample\u weight)`或`(x,y)`。找到:[数组([[[255,255,255],

2024-09-30 12:21:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我们要将现有的Keras SSD7代码转换为克拉斯特遣部队. 我们目前发现了上述错误。我们使用了一个自定义的数据生成器。此外,我们还想知道当从keras转换为克拉斯特遣部队. Github存储库代码取自:https://github.com/pierluigiferrari/ssd_keras

我们在必要的地方改了以下几行。你知道吗

import tensorflow as tf
from tensorflow.python.keras.optimizers import Adam
from tensorflow.python.keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau, TerminateOnNaN, CSVLogger
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.models import load_model

自定义数据类的用法如下:https://github.com/pierluigiferrari/ssd_keras/blob/master/data_generator/object_detection_2d_data_generator.py

我们在转换过程中发现了这个错误

ValueError: Output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: [array([[[[121, 135, 161],
        [114, 130, 155],
        [109, 125, 151],
        ...,

Tags: 代码fromhttpsimportgithubcomdatatensorflow

热门问题