目录
解决问题
Exception "unhandled ValueError"
Subshape must have computed start >= end since stride is negative, but is 0 and 2 (computed from start 0 and end 9223372036854775807 over shape with rank 2 and stride-1)
解决思路
异常“未处理的ValueError”
子形状必须计算开始>=结束,因为步幅为负数,但为0和2(从开始0和结束9223372036854775807开始计算,在等级为2和步幅为1的形状上)
解决方法
参考文章:https://stackoverflow.com/questions/57558476/training-a-keras-model-yields-multiple-optimizer-errors
修改yolo3/model.py文件的140/141行 :
将
1. box_xy = (K.sigmoid(feats[..., :2]) + grid) / K.cast(grid_shape[::-1], K.dtype(feats)) 2. box_wh = K.exp(feats[..., 2:4]) * anchors_tensor / K.cast(input_shape[::-1], K.dtype(feats))
改为
1. box_xy = (K.sigmoid(feats[..., :2]) + grid) / K.cast(grid_shape[...,::-1], K.dtype(feats)) 2. box_wh = K.exp(feats[..., 2:4]) * anchors_tensor / K.cast(input_shape[...,::-1], K.dtype(feats))