成功解决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)
目录
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行 :
将
- box_xy = (K.sigmoid(feats[..., :2]) + grid) / K.cast(grid_shape[::-1], K.dtype(feats))
- box_wh = K.exp(feats[..., 2:4]) * anchors_tensor / K.cast(input_shape[::-1], K.dtype(feats))
改为
- box_xy = (K.sigmoid(feats[..., :2]) + grid) / K.cast(grid_shape[...,::-1], K.dtype(feats))
- box_wh = K.exp(feats[..., 2:4]) * anchors_tensor / K.cast(input_shape[...,::-1], K.dtype(feats))
网站声明:如果转载,请联系本站管理员。否则一切后果自行承担。
添加我为好友,拉您入交流群!
请使用微信扫一扫!