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
- Original URL
- State: open
- Created 6 years ago
- Comments: 28
Although I don’t think it is the best method, this way it worked. Please rewrite it as follows.
https://github.com/qqwweee/keras-yolo3/blob/da7d756b0e47b979e701f0131ba7074ea138add8/yolo3/model.py#L412
return K.expand_dims(loss, axis=0)https://github.com/qqwweee/keras-yolo3/blob/da7d756b0e47b979e701f0131ba7074ea138add8/train.py#L53-L55
https://github.com/qqwweee/keras-yolo3/blob/da7d756b0e47b979e701f0131ba7074ea138add8/train.py#L73
'yolo_loss': lambda y_true, y_pred: y_pred[0]add
multi_gpu_modelon yolo_body (before yolo_loss) may workI have pushed the useable code for training multi_gpu_model for YOLOv3 with multiple backbones, please visit https://github.com/anvien/Multi-YOLOv3