ksaito-ut / openworld_ldet

MIT License
54 stars 2 forks source link

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

Open binyisu opened 2 years ago

binyisu commented 2 years ago

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

ksaito-ut commented 2 years ago

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.

binyisu commented 2 years ago

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 commented 2 years ago

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