easton-cau / SOTR

SOTR: Segmenting Objects with Transformers
MIT License
193 stars 32 forks source link

TypeError when I try to train #6

Closed ChengChen2020 closed 3 years ago

ChengChen2020 commented 3 years ago

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

Please install detectron2==0.2.1.

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

cd detectron2 && pip install -e .