Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

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

Open
HaroldHuanrongLIU opened this issue Mar 5, 2023 · 3 comments

Comments

@HaroldHuanrongLIU
Copy link

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

@yujheli
Copy link
Contributor

yujheli commented Mar 31, 2023

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

@lcylmhlcy
Copy link

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

@lcylmhlcy
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants