Invalid argument: Subshape must have computed start >= end since stride is negative, but is 0 and 2

keras-yolov3在win10下训练目标检测算法,

【win10 + gpu 3090 + cuda_10.0.130_411.31_win10 + cudnn-10.0-windows10-x64-v7.6.5.32】

报错如下:

......E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] layout failed: Invalid argument: 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)
......E tensorflow/core/grappler/optimizers/meta_optimizer.cc:502] remapper failed: Invalid argument: 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)

cuda10下载地址:

CUDA Toolkit 10.0 Archive | NVIDIA DeveloperSelect Target Platform Click on the green buttons that describe your target platform. Only supported platforms will be shown. Operating System Architecture Distribution Version Installer Type Do you want to cross-compile? Yes No Select Host Platform Click on the green buttons that describe your host platform. Only supported platforms will be shown. Operating Systemhttps://developer.nvidia.com/cuda-10.0-download-archive?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal建议下载 exe(local)安装包,虽文件比较大,但一般安装没问题。

安装默认目录是:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0

Invalid argument: Subshape must have computed start >= end since stride is negative, but is 0 and 2_第1张图片

 Invalid argument: Subshape must have computed start >= end since stride is negative, but is 0 and 2_第2张图片

cudnn下载地址:

cuDNN Archive | NVIDIA DeveloperNVIDIA cuDNN is a GPU-accelerated library of primitives for deep neural networks.https://developer.nvidia.cn/rdp/cudnn-archive

以下是windows的对应关系:

Invalid argument: Subshape must have computed start >= end since stride is negative, but is 0 and 2_第3张图片

 Invalid argument: Subshape must have computed start >= end since stride is negative, but is 0 and 2_第4张图片

 解决方法:

Invalid argument: Subshape must have computed start >= end since stride is negative, but is 0 and 2_第5张图片

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

你可能感兴趣的:(目标检测,yolov3,计算机视觉,python,目标检测)