chanchanchan97 / ICAFusion

ICAFusion: Iterative Cross-Attention Guided Feature Fusion for Multispectral Object Detection, Pattern Recognition
GNU Affero General Public License v3.0
94 stars 7 forks source link

NameError: name 'RegistrationBlock' is not defined #3

Open xuzhuoyue opened 10 months ago

xuzhuoyue commented 10 months ago

Traceback (most recent call last): File "train.py", line 588, in train_rgb_ir(hyp, opt, device, tb_writer) File "train.py", line 92, in train_rgb_ir model = Model(opt.cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create File "/root/ICAFusion-main/models/yolo_test.py", line 96, in init self.model, self.save = parse_model(deepcopy(self.yaml), ch=[ch]) # model, savelist File "/root/ICAFusion-main/models/yolo_test.py", line 302, in parse_model elif m in [TransformerFusionBlock, RegistrationBlock, STNFusionBlock]: NameError: name 'RegistrationBlock' is not defined

xuzhuoyue commented 10 months ago

May I ask why name 'RegistrationBlock' is not defined appears?

chanchanchan97 commented 10 months ago

You can delete it in "elif m in [TransformerFusionBlock, RegistrationBlock, STNFusionBlock]:". I may not define this function in common.py.

Kai-C-Kaslana commented 10 months ago

Traceback (most recent call last): File "train.py", line 588, in train_rgb_ir(hyp, opt, device, tb_writer) File "train.py", line 92, in train_rgb_ir model = Model(opt.cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create File "/amax/home/chenzhaokai/ICAFusion/models/yolo_test.py", line 96, in init self.model, self.save = parse_model(deepcopy(self.yaml), ch=[ch]) # model, savelist File "/amax/home/chenzhaokai/ICAFusion/models/yolo_test.py", line 308, in parse_model c2 = ch[f] TypeError: list indices must be integers or slices, not list Exercuse me, after deleting "elif m in [TransformerFusionBlock, RegistrationBlock, STNFusionBlock]:",the new error appears as mentioned above. I tried to use "ch=ch[f[0]]" to replace "c2 = ch[f]" but it didn't work. so I would like to ask how to fix that error?

chanchanchan97 commented 10 months ago

Sorry, you just delete the list element 'RegistrationBlock' in "elif m in [TransformerFusionBlock, RegistrationBlock, STNFusionBlock]:". The modified code should be "elif m in [TransformerFusionBlock, TNFusionBlock]:".

ztyzt commented 9 months ago

May I ask why name 'RegistrationBlock' is not defined appears?

你好,请问我可以向你请教这个项目有关运行准备方面的问题吗?(比如一些参数还有路径的配置问题)

zhangxin253675 commented 7 months ago

您好!我将RegistrationBlock删除了,之后报错:Traceback (most recent call last): File "/home/zx/PycharmProjects/det_fuxian/ICAFusion-main/train.py", line 588, in train_rgb_ir(hyp, opt, device, tb_writer) File "/home/zx/PycharmProjects/det_fuxian/ICAFusion-main/train.py", line 92, in train_rgb_ir model = Model(opt.cfg or ckpt['model'].yaml, ch=3, nc=nc, anchors=hyp.get('anchors')).to(device) # create File "/home/zx/PycharmProjects/det_fuxian/ICAFusion-main/models/yolo_test.py", line 96, in init self.model, self.save = parse_model(deepcopy(self.yaml), ch=[ch]) # model, savelist File "/home/zx/PycharmProjects/det_fuxian/ICAFusion-main/models/yolo_test.py", line 305, in parse_model elif m in [TransformerFusionBlock, STNFusionBlock]: NameError: name 'STNFusionBlock' is not defined