We provide installation instructions for ImageNet classification experiments here.
Create an new conda virtual environment
conda create -n convnextv2 python=3.8 -y
conda activate convnextv2
Install Pytorch>=1.8.0, torchvision>=0.9.0 following official instructions. For example:
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
Clone this repo and install required packages:
git clone https://github.com/facebookresearch/ConvNeXt-V2.git
pip install timm==0.3.2 tensorboardX six
pip install submitit
conda install openblas-devel -c anaconda -y
Install MinkowskiEngine:
(Note: we have implemented a customized CUDA kernel for depth-wise convolutions, which the original MinkowskiEngine does not support.)
git submodule update --init --recursive
git submodule update --recursive --remote
cd MinkowskiEngine
python setup.py install --blas_include_dirs=${CONDA_PREFIX}/include --blas=openblas
Install 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 ..
Download the ImageNet-1K classification dataset and structure the data as follows:
/path/to/imagenet-1k/
train/
class1/
img1.jpeg
class2/
img2.jpeg
val/
class1/
img3.jpeg
class2/
img4.jpeg
For pre-training on ImageNet-22K, download the dataset and structure the data as follows:
/path/to/imagenet-22k/
class1/
img1.jpeg
class2/
img2.jpeg
class3/
img3.jpeg
class4/
img4.jpeg