Giter Site home page Giter Site logo

Comments (19)

chensnathan avatar chensnathan commented on June 27, 2024

You can specify GPU ids with CUDA_VISIBLE_DEVICES. For example CUDA_VISIBLE_DEVICES=4,5,6,7 pods_train --num-gpus 4, it will use the last 4 GPUs for training. You may need to adjust the warmup iterations and warmup factor when you use fewer GPUs for training.

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

I added statements:os.environ['CUDA_VISIBLE_DEVICES'] = '0, 1' in the train_net script。When performing train_net script training, Report an error:
Default process group is not initialized
How to solve it?
And the default batch_ size is 4, I use two 3090 and the memory is 24G to train, how to modify the size of the batch size?

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

oh,I know that I need to modify the IMS_PER_BATCH and IMS_PER_DEVICE parameter in the config script to change its batch_size.
But, for the training of two 3090 graphics cards, I will change WARMUP_FACTOR and WARMUP_ITERS parameters should be ?

from yolof.

chensnathan avatar chensnathan commented on June 27, 2024

When you use two GPUs, the error Default process group is not initialized should not show up.

For changing the WARMUP_FACTOR and WARMUP_ITERS:
WARMUP_ITERS = 1500 * 8 / NUM_GPUS
WARMUP_FACTOR = 1. / WARMUP_ITERS

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

I have now modified the corresponding parameters in the config script, but run train_ net script still reports an error:
Default process group is not initialized

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

Traceback (most recent call last):
File "train_net.py", line 106, in
launch(
File "/media/data/huzhen/YOLOF-torch/cvpods/engine/launch.py", line 56, in launch
main_func(*args)
File "train_net.py", line 96, in main
runner.train()
File "/media/data/huzhen/YOLOF-torch/cvpods/engine/runner.py", line 270, in train
super().train(self.start_iter, self.start_epoch, self.max_iter)
File "/media/data/huzhen/YOLOF-torch/cvpods/engine/base_runner.py", line 84, in train
self.run_step()
File "/media/data/huzhen/YOLOF-torch/cvpods/engine/base_runner.py", line 185, in run_step
loss_dict = self.model(data)
File "/home/hz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/media/data/huzhen/YOLOF-torch/playground/detection/coco/yolof/yolof_base/yolof.py", line 133, in forward
losses = self.losses(
File "/media/data/huzhen/YOLOF-torch/playground/detection/coco/yolof/yolof_base/yolof.py", line 211, in losses
dist.all_reduce(num_foreground)
File "/home/hz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/distributed/distributed_c10d.py", line 953, in all_reduce
_check_default_pg()
File "/home/hz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/distributed/distributed_c10d.py", line 210, in _check_default_pg
assert _default_pg is not None,
AssertionError: Default process group is not initialized

from yolof.

chensnathan avatar chensnathan commented on June 27, 2024

Could you provide more details about your command for training?

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

I am using the train_net script under tools folder for training, Some parameters in the config script are adjusted, including IMS_PER_BATCH, IMS_PER_DEVICE, WARMUP_FACTOR and WARMUP_ITERS parameters。And add extra statement in the train_net script : os.environ['CUDA_VISIBLE_DEVICES'] = '0, 1'.
And update the path of Dataset in the base_dataset script.
Other default parameters and hyper-paramters dont change.

from yolof.

chensnathan avatar chensnathan commented on June 27, 2024

You need to add --num-gpus to your command when you train with yolof.
BTW, we recommend using pods_train as given in README.

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

Now there is a new error in the 'dist URL' parameter:
cvpods.engine.launch ERROR: Process group URL: tcp://127.0.0.1:50147
RuntimeError: Address already in use

ai...Your code actually is too hard to run。。。。

from yolof.

chensnathan avatar chensnathan commented on June 27, 2024

Why not just follow the steps in README. It should work well.

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

Using the method in REDEME to train, it can only modify the number of GPUs, but it definitely can't update the identifier of GPU to train at all.

from yolof.

chensnathan avatar chensnathan commented on June 27, 2024

It can.... I give an exmaple above.

You can specify GPU ids with CUDA_VISIBLE_DEVICES. For example CUDA_VISIBLE_DEVICES=4,5,6,7 pods_train --num-gpus 4, it will use the last 4 GPUs for training. You may need to adjust the warmup iterations and warmup factor when you use fewer GPUs for training.

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

Ok,I konw. Take 2 GPUs for training , it still report error :
assert base_world_size == 8, "IMS_PER_BATCH/DEVICE in config file is used for 8 GPUs"
AssertionError: IMS_PER_BATCH/DEVICE in config file is used for 8 GPUs

The number of GPUs required by your code is too large. My team only has 4 GPUs per machine,I don't think I can train.....ai....

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

I useing 4 GPUs for training with the way you provided, like this:
CUDA_VISIBLE_DEVICES=0,1,2,3 pods_train --num-gpus 4

But it still report a error :
RuntimeError: NCCL error in: /opt/conda/conda-bld/pytorch_1607370156314/work/torch/lib/c10d/ProcessGroupNCCL.cpp:784, invalid usage, NCCL version 2.7.8

How could I solve it ? Thanks !

from yolof.

chensnathan avatar chensnathan commented on June 27, 2024

Many reasons can produce this error. You can refer to this solution and have a try.

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

OK,I trying to see if I could work it out. Thanks !

from yolof.

xuyuyan123 avatar xuyuyan123 commented on June 27, 2024

这个代码太难跑了

from yolof.

Huzhen757 avatar Huzhen757 commented on June 27, 2024

这个代码太难跑了

是的,很难跑,他是与基于cvpods库实现的, 需要安装这个库然后编译这个库,然后在源码中还要编译。而且最少要四张卡才能跑,非常吃显卡。。。之前我试了4张2080ti跑,结果还是报错,也就是上面个的error。难定,不想train这个代码了,其实这篇论文的encoder部分倒是可以学习的,其他的地方我懒得花时间了。。还得跑自己的实验,唉。。。

from yolof.

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.