Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when I try to train #6

Closed
ChengChen2020 opened this issue Sep 19, 2021 · 1 comment
Closed

TypeError when I try to train #6

ChengChen2020 opened this issue Sep 19, 2021 · 1 comment

Comments

@ChengChen2020
Copy link

With this command

python tools/train_net.py \
    --config-file configs/SOTR/R101.yaml \
    --num-gpus 1

I get error

File "tools/train_net.py", line 52, in __init__
    super(DefaultTrainer, self).__init__(model, data_loader, optimizer)
TypeError: __init__() takes 1 positional argument but 4 were given

My environment

torch==1.7.1
torchvision==0.9.2
detectron2==0.5

I am not sure what to do with it. Maybe try

detectron2==0.2.1 with torch==1.6

python -m pip install detectron2==0.2.1 -f \
  https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.6/index.html

Can you help me with this?

@easton-cau
Copy link
Owner

Please install detectron2==0.2.1.

Build detectron2 from source. (https://detectron2.readthedocs.io/en/latest/tutorials/install.html)

cd detectron2 && pip install -e .

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

No branches or pull requests

2 participants