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

How to run repVit's detection network in one GPU environment #48

Open
weldingCode opened this issue Mar 29, 2024 · 6 comments
Open

How to run repVit's detection network in one GPU environment #48

weldingCode opened this issue Mar 29, 2024 · 6 comments

Comments

@weldingCode
Copy link

My experimental environment only has 1 GPU. How do I run the network under detection file?

@jameslahm
Copy link
Collaborator

Thanks for your interest. You could set #GPUS to 1, like below:

./dist_test.sh config_file path/to/checkpoint 1 --eval bbox segm

@weldingCode
Copy link
Author

(yolov8) root@n1:/home/repvit/detection# ./dist_train.sh configs/mask_rcnn_repvit_m1_1_fpn_1x_coco.py 1 /opt/conda/envs/yolov8/lib/python3.9/site-packages/torch/distributed/launch.py:178: FutureWarning: The module torch.distributed.launch is deprecated and will be removed in future. Use torchrun. Note that --use_env is set by default in torchrun. If your script expects --local_rank argument to be set, please change it to read from os.environ['LOCAL_RANK'] instead. See https://pytorch.org/docs/stable/distributed.html#launch-utility for further instructions

warnings.warn(

/opt/conda/envs/yolov8/lib/python3.9/site-packages/mmcv/init.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details.
warnings.warn(
usage: train.py [-h] [--work-dir WORK_DIR] [--resume-from RESUME_FROM] [--auto-resume] [--no-validate]
[--gpus GPUS | --gpu-ids GPU_IDS [GPU_IDS ...] | --gpu-id GPU_ID] [--seed SEED] [--diff-seed] [--deterministic]
[--options OPTIONS [OPTIONS ...]] [--cfg-options CFG_OPTIONS [CFG_OPTIONS ...]] [--launcher {none,pytorch,slurm,mpi}]
[--local-rank LOCAL_RANK] [--auto-scale-lr]
config
train.py: error: unrecognized arguments: --local_rank=0
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 2) local_rank: 0 (pid: 3564) of binary: /opt/conda/envs/yolov8/bin/python
Traceback (most recent call last):
File "/opt/conda/envs/yolov8/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/opt/conda/envs/yolov8/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/opt/conda/envs/yolov8/lib/python3.9/site-packages/torch/distributed/launch.py", line 193, in
main()
File "/opt/conda/envs/yolov8/lib/python3.9/site-packages/torch/distributed/launch.py", line 189, in main
launch(args)
File "/opt/conda/envs/yolov8/lib/python3.9/site-packages/torch/distributed/launch.py", line 174, in launch
run(args)
File "/opt/conda/envs/yolov8/lib/python3.9/site-packages/torch/distributed/run.py", line 710, in run
elastic_launch(
File "/opt/conda/envs/yolov8/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 131, in call
return launch_agent(self._config, self._entrypoint, list(args))
File "/opt/conda/envs/yolov8/lib/python3.9/site-packages/torch/distributed/launcher/api.py", line 259, in launch_agent
raise ChildFailedError(
torch.distributed.elastic.multiprocessing.errors.ChildFailedError:

./train.py FAILED

Failures:

<NO_OTHER_FAILURES>

Root Cause (first observed failure):

[0]:
time : 2024-03-29_11:20:28
host : n1.example.com
rank : 0 (local_rank: 0)
exitcode : 2 (pid: 3564)
error_file: <N/A>
traceback : To enable traceback see: https://pytorch.org/docs/stable/elastic/errors.html

会报这个错误

@weldingCode
Copy link
Author

Can I use the command "python train.py configs/mask_rcnn_repvit_m1_1_fpn_1x_coco.py 1"?

@jameslahm
Copy link
Collaborator

According to your error log, I guess that you could change --local-rank to --local_rank to address that problem.

@weldingCode
Copy link
Author

According to your error log, I guess that you could change --local-rank to --local_rank to address that problem.

I still can not solve my problem, the most prompt is the version information does not match, can you update the tutorial?

@jameslahm
Copy link
Collaborator

parser.add_argument('--local-rank', type=int, default=0)

Hi, this line can be changed to

parser.add_argument('--local_rank', type=int, default=0)

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