keras-yolo3: problem with mutil GPU in keras

when i try to use model = multi_gpu_model(model,gpus=3) in my data,there is a error occured:

tensorflow.python.framework.errors_impl.InvalidArgumentError: Can’t concatenate scalars (use tf.stack instead) for ‘yolo_loss_1/concat’ (op: ‘ConcatV2’) with input shapes: [], [], [], [].

my enviroment is tensorflow-1.8 gpu, keras 2.20,titan xp please help me fix it! thx!

About this issue

Most upvoted comments

add multi_gpu_model on yolo_body (before yolo_loss) may work

    model_body = tiny_yolo_body(image_input, num_anchors//2, num_classes)
    if gpus > 1:
        model_body = multi_gpu_model(model_body, gpus=gpus)

I have pushed the useable code for training multi_gpu_model for YOLOv3 with multiple backbones, please visit https://github.com/anvien/Multi-YOLOv3