Fixed saving of train image

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-06-24 10:52:52 +02:00
parent a0b1c98fb4
commit 392927d4c7

View File

@ -87,8 +87,9 @@ def _ssd_train(args: argparse.Namespace) -> None:
if args.debug: if args.debug:
train_image, _ = next(train_generator) train_image, _ = next(train_generator)
train_length -= 1 train_length -= 1
import cv2 from PIL import Image
cv2.imwrite(f"{args.summary_path}/train/{args.network}/{args.iteration}/train.png", train_image) image = Image.fromarray(train_image)
image.save(f"{args.summary_path}/train/{args.network}/{args.iteration}/train_image.png")
nr_batches_train = int(math.floor(train_length / batch_size)) nr_batches_train = int(math.floor(train_length / batch_size))
nr_batches_val = int(math.floor(val_length / batch_size)) nr_batches_val = int(math.floor(val_length / batch_size))