aim-uofa / AdelaiDet

AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.

Home Page:https://git.io/AdelaiDet

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RuntimeError: ArrayRef: invalid index Index = 15; Length = 15

zxcvbml opened this issue · comments

[03/25 09:58:22 detectron2]: load Model:
../../../data/DCIS/exp_pth/FCOS_R_50_1x.pth
Traceback (most recent call last):
File "onnx/export_model_to_onnx.py", line 302, in
main()
File "onnx/export_model_to_onnx.py", line 294, in main
output_names=output_names,
File "/root/miniconda3/envs/detectron2/lib/python3.7/site-packages/torch/onnx/init.py", lin
e 276, in export custom_opsets, enable_onnx_checker, use_external_data_format)
File "/root/miniconda3/envs/detectron2/lib/python3.7/site-packages/torch/onnx/utils.py", line 9
4, in export use_external_data_format=use_external_data_format)
File "/root/miniconda3/envs/detectron2/lib/python3.7/site-packages/torch/onnx/utils.py", line 7
01, in _export dynamic_axes=dynamic_axes)
File "/root/miniconda3/envs/detectron2/lib/python3.7/site-packages/torch/onnx/utils.py", line 4
88, in _model_to_graph torch._C._jit_pass_onnx_assign_output_shape(graph, output_tensors, out_desc, _onnx_shape_infe
rence)RuntimeError: ArrayRef: invalid index Index = 15; Length = 15

torch 1.8.1+cu101
python 3.7.4

the BlendMask config as follow:
BASE: "Base-550.yaml"
INPUT:
MIN_SIZE_TRAIN: (256, 288, 320, 352, 384, 416, 448, 480, 512, 544, 576, 608)
MAX_SIZE_TRAIN: 900
MAX_SIZE_TEST: 736
MIN_SIZE_TEST: 512
MODEL:
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
RESNETS:
DEPTH: 50
NORM: "SyncBN"
BACKBONE:
FREEZE_AT: -1
FCOS:
NORM: "SyncBN"
SOLVER:
STEPS: (300000, 340000)
MAX_ITER: 360000
OUTPUT_DIR: "output/blendmask/RT_R_50_4x-bn-head"

#----------------------------------------------------------------------------------------------------------------#

I have tried many pth model including FCOS, BlensMasks , that Will make the same ArrayRef error.
I hope to get some suggestions. Thank you a lot.

I also encountered the same problem. Have you solved it?
RuntimeError: ArrayRef: invalid index Index = 21; Length = 21

I also encountered the same problem. Have you solved it? RuntimeError: ArrayRef: invalid index Index = 21; Length = 21

首先查看模型的FCOS head的cls_tower和bbox_tower是否为空,我的某些模型会出现为“ (cls_tower): Sequential(),(bbox_tower): Sequential()”,然后选用了不为空的权重模型, 发现无法进入如下if语句 if yield_bbox_towers: bbox_towers.append(bbox_tower) 去掉if 直接append。成功。(在/export_model_to_onnx.py下修改)