TACJu / TransFG

This is the official PyTorch implementation of the paper "TransFG: A Transformer Architecture for Fine-grained Recognition" (Ju He, Jie-Neng Chen, Shuai Liu, Adam Kortylewski, Cheng Yang, Yutong Bai, Changhu Wang, Alan Yuille).
MIT License
382 stars 88 forks source link

ImportError: cannot import name 'Di1stributedDataParallel' from 'apex.parallel' #22

Open HePengguang opened 2 years ago

HePengguang commented 2 years ago

The paltform is window10, and there is only one GPU=RTX GeForce 3080 pytorch version==1.7.1, tensorboard version ==1.15.0, apex version==0.1 Q: Every time when i tried to train with the command "train.py --dataset CUB_200_2011 --split overlap --num_steps 10000 --fp16 --name sample_run", it always gave me a error feedback, like "ImportError: cannot import name 'Di1stributedDataParallel' from 'apex.parallel' " Any guy know what is the reason causing this error? If you know some likely reasons, please tell me, thank you so much. God bless you!

HePengguang commented 2 years ago

maybe it's beacause the platform, we can directly annotate the line "from apex.parallel import Di1stributedDataParallel as DDP"

Kelly510 commented 1 year ago

I had the same problem. It can be solved by installing apex in apex_no_distributed branch of this repo. The commands are as follows.

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