Giter VIP home page Giter VIP logo

Comments (8)

HIT-cwh avatar HIT-cwh commented on August 18, 2024 1

Thank you for your issue.
At present, distributed mode is needed when searching even if only one gpu is used. It is hacky and we are refactoring the search part. The new version will no longer have this problem.

from mmrazor.

tanghy2016 avatar tanghy2016 commented on August 18, 2024

这个问题现在的版本解决了吗?我也遇到一样的问题

from mmrazor.

HIT-cwh avatar HIT-cwh commented on August 18, 2024

You can avoid this by trying distributed mode.

Plus, using English is more appreciated for better community discussion around the world.

from mmrazor.

tanghy2016 avatar tanghy2016 commented on August 18, 2024

where to do the setup you said

from mmrazor.

HIT-cwh avatar HIT-cwh commented on August 18, 2024

where to do the setup you said

You can set the job launcher to one of pytorch, slurm or mpi (ref to here ) to use distributed mode.

from mmrazor.

tanghy2016 avatar tanghy2016 commented on August 18, 2024
$ python ./tools/mmcls/search_mmcls.py \
>   configs/pruning/autoslim/autoslim_mbv2_search_8xb1024_ci10.py \
>   output/epoch_50.pth \
>   --work-dir output \
>   --launcher pytorch
/home/tanghuayang/venv_torch/lib/python3.6/site-packages/mmrazor/utils/setup_env.py:33: UserWarning: Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
  f'Setting OMP_NUM_THREADS environment variable for each process '
/home/tanghuayang/venv_torch/lib/python3.6/site-packages/mmrazor/utils/setup_env.py:43: UserWarning: Setting MKL_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
  f'Setting MKL_NUM_THREADS environment variable for each process '
Traceback (most recent call last):
  File "./tools/mmcls/search_mmcls.py", line 181, in <module>
    main()
  File "./tools/mmcls/search_mmcls.py", line 99, in main
    init_dist(args.launcher, **cfg.dist_params)
  File "/home/tanghuayang/venv_torch/lib64/python3.6/site-packages/mmcv/runner/dist_utils.py", line 18, in init_dist
    _init_dist_pytorch(backend, **kwargs)
  File "/home/tanghuayang/venv_torch/lib64/python3.6/site-packages/mmcv/runner/dist_utils.py", line 29, in _init_dist_pytorch
    rank = int(os.environ['RANK'])
  File "/usr/lib64/python3.6/os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'RANK'

Is it necessary to configure cfg.dist_params? And, how to configure it?

from mmrazor.

tanghy2016 avatar tanghy2016 commented on August 18, 2024
$ python ./tools/mmcls/search_mmcls.py \
>   configs/pruning/autoslim/autoslim_mbv2_search_8xb1024_ci10.py \
>   output/epoch_50.pth \
>   --work-dir output \
>   --launcher pytorch
/home/tanghuayang/venv_torch/lib/python3.6/site-packages/mmrazor/utils/setup_env.py:33: UserWarning: Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
  f'Setting OMP_NUM_THREADS environment variable for each process '
/home/tanghuayang/venv_torch/lib/python3.6/site-packages/mmrazor/utils/setup_env.py:43: UserWarning: Setting MKL_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
  f'Setting MKL_NUM_THREADS environment variable for each process '
Traceback (most recent call last):
  File "./tools/mmcls/search_mmcls.py", line 181, in <module>
    main()
  File "./tools/mmcls/search_mmcls.py", line 99, in main
    init_dist(args.launcher, **cfg.dist_params)
  File "/home/tanghuayang/venv_torch/lib64/python3.6/site-packages/mmcv/runner/dist_utils.py", line 18, in init_dist
    _init_dist_pytorch(backend, **kwargs)
  File "/home/tanghuayang/venv_torch/lib64/python3.6/site-packages/mmcv/runner/dist_utils.py", line 29, in _init_dist_pytorch
    rank = int(os.environ['RANK'])
  File "/usr/lib64/python3.6/os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'RANK'

Is it necessary to configure cfg.dist_params? And, how to configure it?

it's runing, use the following command:

$ RANK=0 WORLD_SIZE=1 MASTER_ADDR=127.0.0.1 MASTER_PORT=1692 python ./tools/mmcls/search_mmcls.py \
  configs/pruning/autoslim/autoslim_mbv2_search_8xb1024_ci10.py \
  output/epoch_50.pth \
  --work-dir output \
  --launcher pytorch

from mmrazor.

tanghy2016 avatar tanghy2016 commented on August 18, 2024
$ python ./tools/mmcls/search_mmcls.py \
>   configs/pruning/autoslim/autoslim_mbv2_search_8xb1024_ci10.py \
>   output/epoch_50.pth \
>   --work-dir output \
>   --launcher pytorch
/home/tanghuayang/venv_torch/lib/python3.6/site-packages/mmrazor/utils/setup_env.py:33: UserWarning: Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
  f'Setting OMP_NUM_THREADS environment variable for each process '
/home/tanghuayang/venv_torch/lib/python3.6/site-packages/mmrazor/utils/setup_env.py:43: UserWarning: Setting MKL_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
  f'Setting MKL_NUM_THREADS environment variable for each process '
Traceback (most recent call last):
  File "./tools/mmcls/search_mmcls.py", line 181, in <module>
    main()
  File "./tools/mmcls/search_mmcls.py", line 99, in main
    init_dist(args.launcher, **cfg.dist_params)
  File "/home/tanghuayang/venv_torch/lib64/python3.6/site-packages/mmcv/runner/dist_utils.py", line 18, in init_dist
    _init_dist_pytorch(backend, **kwargs)
  File "/home/tanghuayang/venv_torch/lib64/python3.6/site-packages/mmcv/runner/dist_utils.py", line 29, in _init_dist_pytorch
    rank = int(os.environ['RANK'])
  File "/usr/lib64/python3.6/os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'RANK'

Is it necessary to configure cfg.dist_params? And, how to configure it?

it's runing, use the following command:

$ RANK=0 WORLD_SIZE=1 MASTER_ADDR=127.0.0.1 MASTER_PORT=1692 python ./tools/mmcls/search_mmcls.py \
  configs/pruning/autoslim/autoslim_mbv2_search_8xb1024_ci10.py \
  output/epoch_50.pth \
  --work-dir output \
  --launcher pytorch

but, how to write these configuration parameters into cfg.dist_params?

from mmrazor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.