megvii-research / RevCol

Official Code of Paper "Reversible Column Networks" "RevColv2"
Apache License 2.0
246 stars 10 forks source link

TypeError: main() takes 1 positional argument but 3 were given #7

Closed JackTesla closed 1 year ago

JackTesla commented 1 year ago

When I run the following command :

python main.py  --cfg configs/revcol_base_1k_384_finetune.yaml --batch-size 4 \
    --data-path ../data/classification --finetune revcol_base_22k.pth

It outputs this:

=> merge config from configs/revcol_base_1k_384_finetune.yaml
Traceback (most recent call last):
  File "main.py", line 422, in <module>
    main(None, config, ngpus_per_node)
TypeError: main() takes 1 positional argument but 3 were given
nightsnack commented 1 year ago

Please use torchrun as mentioned in INSTRUCTION.md. torchrun --nproc_per_node=<num-of-gpus-to-use> --master_port=23456 main.py \ --cfg <config-file> --data-path <imagenet-path> [--batch-size <batch-size-per-gpu> --output <output-directory> --tag <job-tag>]

JackTesla commented 1 year ago

Actually, I used torchrun too. The error still exists.

This is an error caused by main.py which I've commited.

nightsnack commented 1 year ago

Yes, you are right. Resolved.