openworld_ldet icon indicating copy to clipboard operation
openworld_ldet copied to clipboard

AttributeError: type object 'Tensor' has no attribute 'cat'

Open binyisu opened this issue 2 years ago • 3 comments

File "/home/subinyi/anaconda3/envs/ldet/lib/python3.7/site-packages/detectron2/modeling/box_regression.py", line 327, in _dense_box_regression_loss anchors = type(anchors[0]).cat(anchors).tensor # (R, 4) AttributeError: type object 'Tensor' has no attribute 'cat'

i dont know how to solve this issue? can you help me

binyisu avatar Mar 11 '22 07:03 binyisu

Do you have the issue when running trainer_ldet.py. or trainer_plain.py? We do not make a change on the model side and if the problem happens in both training scripts, the issue may be due to detectron2.

ksaito-ut avatar Mar 11 '22 20:03 ksaito-ut

i have solved this problem, in detectron2 box_regession.py, i use: ######## if len(anchors)==1: anchors = anchors[0] else: anchors = type(anchors[0]).cat(anchors).tensor # (R, 4) to replace: anchors = type(anchors[0]).cat(anchors).tensor # (R, 4)

binyisu avatar Mar 12 '22 01:03 binyisu

I am a rookie. I want to ask: what are the key questions of owod? can you share your thoughts? thanks

binyisu avatar Mar 12 '22 01:03 binyisu