From efda35adb7667c01f10c2c74bc24a661b21838bc Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 5 Jun 2019 12:35:08 +0200 Subject: [PATCH] Fixed encoding of labels Signed-off-by: Jim Martens --- src/twomartens/masterthesis/ssd.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/twomartens/masterthesis/ssd.py b/src/twomartens/masterthesis/ssd.py index 7266472..4f202fa 100644 --- a/src/twomartens/masterthesis/ssd.py +++ b/src/twomartens/masterthesis/ssd.py @@ -456,7 +456,12 @@ def _train_one_epoch(epoch: int, # go through data set for x, y in dataset: - encoded_ground_truth = input_encoder(y) + labels = [] + for i in range(y.shape[0]): + image_labels = np.asarray(y[i]) + image_labels = image_labels[image_labels[:, 0] != -1] + labels.append(image_labels) + encoded_ground_truth = input_encoder(labels) ssd_train_loss = _train_ssd_step(ssd=ssd, optimizer=ssd_optimizer, inputs=x,