facebookresearch/adaptive_teacher

TypeError: register_buffer() takes 3 positional arguments but 4 were given

HaroldHuanrongLIU opened this issue · 3 comments

Traceback (most recent call last):
File "train_net.py", line 73, in
launch(
File "/root/autodl-tmp/detectron2/detectron2/engine/launch.py", line 62, in launch
main_func(*args)
File "train_net.py", line 63, in main
trainer = Trainer(cfg)
File "/root/autodl-tmp/adaptive_teacher/adapteacher/engine/trainer.py", line 290, in init
model = self.build_model(cfg)
File "/root/autodl-tmp/detectron2/detectron2/engine/defaults.py", line 434, in build_model
model = build_model(cfg)
File "/root/autodl-tmp/detectron2/detectron2/modeling/meta_arch/build.py", line 21, in build_model
model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
File "/root/autodl-tmp/detectron2/detectron2/config/config.py", line 182, in wrapped
init_func(self, **explicit_args)
File "/root/autodl-tmp/adaptive_teacher/adapteacher/modeling/meta_arch/rcnn.py", line 96, in init
self.register_buffer("pixel_mean", torch.tensor(pixel_mean).view(-1, 1, 1), False)
TypeError: register_buffer() takes 3 positional arguments but 4 were given
I followed your method but encountered this error

It might be a bug. Could you check the details of that function?

I also encountered this error.
ubuntu18.04 + python3.6 + cuda 9.2 + torch 1.5.0 + detectron2 0.3

微信截图_20230918110618
upgrade pytorch to >=1.6, get !!!!!