MILVLG / bottom-up-attention.pytorch

A PyTorch reimplementation of bottom-up-attention models
Apache License 2.0
294 stars 76 forks source link

AttributeError: module 'torch.distributed' has no attribute '_all_gather_base' #98

Open codefreakSubham opened 2 years ago

codefreakSubham commented 2 years ago

While running extract_features.py facing the following error:

File "/lfs/usrhome/ms/cs21s058/.conda/envs/caption/lib/python3.7/site-packages/apex-0.1-py3.7.egg/apex/transformer/utils.py", line 11, in AttributeError: module 'torch.distributed' has no attribute '_all_gather_base'

Pytorch version : 1.5.1 CUDA: 10.1 Python 3.7

Anyone please help me out with this issue.

SDWDD commented 2 years ago

I have also encountered this problem, please let me know if there is a solution

tzcskys commented 2 years ago

I have met the same problem

tzcskys commented 2 years ago

I have met the same problem

found the solution, the newest apex (master branch) is not compatible with the old torch version, change to some of older branches e.g. 22.04-dev and it will work. refer to here

184446223 commented 1 year ago

you can use:

pip uninstall apex
rm -rf apex
git clone https://github.com/ptrblck/apex.git
cd apex
git checkout apex_no_distributed
pip install -v --no-cache-dir ./

it can sovle my problem,and it can work well.

hundun0322 commented 1 year ago

Jetson AGX Xavier Jetpack: 4.6 Pytorch version: 1.7.0 CUDA: 10.2 Python: 3.6 The above solutions don't fit me.But I succeed after commenting out the related codes in files.

lxy51 commented 7 months ago

您可以使用:

pip uninstall apex
rm -rf apex
git clone https://github.com/ptrblck/apex.git
cd apex
git checkout apex_no_distributed
pip install -v --no-cache-dir ./

它可以解决我的问题,而且效果很好。

ImportError: cannot import name 'container_abcs' from 'torch._six' (/root/data1/lxy/envs/python38/lib/python3.8/site-packages/torch/_six.py)