成功解决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()`结合使用可创建数组。示例展示了不同参数组合下的序列生成,并将其转换为数组。
|
5月前
|
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()的区别
88 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
814 0
|
PyTorch 算法框架/工具
Please ensure they have the same size. return F.mse_loss(input, target, reduction=self.reduction) 怎么解决?
这个通常是由于 input 和 target 张量的维度不匹配导致的,因此可以通过调整它们的维度来解决。
294 0
|
PyTorch 算法框架/工具
pytorch报错 RuntimeError: The size of tensor a (25) must match the size of tensor b (50) at non-singleton dimension 1 怎么解决?
这个错误提示表明,在进行某个操作时,张量a和b在第1个非单例维(即除了1以外的维度)上的大小不一致。例如,如果a是一个形状为(5, 5)的张量,而b是一个形状为(5, 10)的张量,则在第二个维度上的大小不匹配。
3417 0
The Double Linknode for Linear table | Data
The some code in Data book (5th Edition) from the 54 page to 55 page
83 0
|
人工智能 索引 Python