ziplab / LITv2

[NeurIPS 2022 Spotlight] This is the official PyTorch implementation of "Fast Vision Transformers with HiLo Attention"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with DCN module

sanjana-prabhu opened this issue · comments

Hi,

I am getting this error when I try to train the LITv2 Module on Google Colab.
AttributeError: module 'DCN' has no attribute 'deform_conv2d_forward'. How to solve this?

Hi @sanjana-prabhu, have you successfully installed deformable convolution in your environment? e.g.

cd classification/mm_modules/DCN
# Build Deformable Convolution
python setup.py build install

Hi,
I have installed it from segmentation/mm_modules/DCN

Can you please provide the details of your Python virtual environment?

Thanks for sharing your environment.

Actually, it is quite difficult to debug since the shared env has many irrelavant packages. However, I just created a new Python env with conda,

conda create -n lit python=3.9 -y

conda activate lit

# install pytorch
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113

pip install timm
pip install ninja
pip install tensorboard
pip install prettytable
pip install opencv-python==4.4.0.46 termcolor==1.1.0 yacs==0.1.8


# install NVIDIA apex
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
cd ../
rm -rf apex/

# install deformable convolution
cd segmentation/mm_modules/DCN
python setup.py build install

# install mmcv
pip install mmcv-full==1.6.1


# now we can run the segmentation code
bash tools/dist_train.sh configs/litv2/litv2_s_fpn_r50_512x512_80k_ade20k.py 1  --options model.pretrained=litv2_s.pth

Based on the new created env, I can run the segmentation code without any issues. If possible, please also let me know your detailed errors/logs when using this repo to train your model.

Thanks!