成功解决but is 0 and 2 (computed from start 0 and end 9223372 over shape with rank 2 and stride-1)

简介: 成功解决but is 0 and 2 (computed from start 0 and end 9223372 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行 :

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))


相关文章
range() 函数
`range()`函数在Julia中生成指定范围和步长的序列。它可以有四个参数:`start`(起始值),`stop`(结束值),`length`(长度)和`step`(步长)。例如,`range(1, stop=100)`产生从1到100的序列。如果`length`未指定,序列会在接近`stop`但能被`step`整除的位置结束。`collect()`与`range()`结合使用可创建数组。示例展示了不同参数组合下的序列生成,并将其转换为数组。
|
6月前
|
Linux Windows
【已解决】ValueError: num_samples should be a positive integer value, but got num_samples=0
【已解决】ValueError: num_samples should be a positive integer value, but got num_samples=0
rank()、dense-rank()、row-number()的区别
rank()、dense-rank()、row-number()的区别
100 0
The size of tensor a (4) must match the size of tensor b (3) at non-singletonThe size of
The size of tensor a (4) must match the size of tensor b (3) at non-singletonThe size of
890 0
|
PyTorch 算法框架/工具
Please ensure they have the same size. return F.mse_loss(input, target, reduction=self.reduction) 怎么解决?
这个通常是由于 input 和 target 张量的维度不匹配导致的,因此可以通过调整它们的维度来解决。
310 0
The Double Linknode for Linear table | Data
The some code in Data book (5th Edition) from the 54 page to 55 page
92 0
|
TensorFlow 算法框架/工具
ValueError: Negative dimension size caused by subtracting 5 from 1 for ‘{{node le_net5/conv2d/Conv2D
ValueError: Negative dimension size caused by subtracting 5 from 1 for ‘{{node le_net5/conv2d/Conv2D
174 0
|
人工智能 索引 Python
|
数据库
Data truncation: Out of range value for column ‘estimate_score‘
Data truncation: Out of range value for column ‘estimate_score‘