mmcv icon indicating copy to clipboard operation
mmcv copied to clipboard

MMCV and MMFLOW version conflicts with PyTorch 2.0

Open Riponcs opened this issue 1 year ago • 3 comments

I have Pytorch 2.0 and Cuda 11.8 installed. So, I have followed the official instructions to install MMCV 2. And then, I installed the MMFLOW (as I want to run optical FLow) based on this documentation.

I verified the installation by downloading the checkpoints and it works.

However, When I try to import mmflow, It provides me an error:- **AssertionError: MMCV==2.0.0 is used but incompatible. Please install mmcv>=1.3.15, <1.8.0.**

I have added the reproducible error in Google Colab Notebook.

Riponcs avatar Apr 07 '23 08:04 Riponcs

Hi @Riponcs , thanks for your feedback.

The OpenMMLab team released a new generation of training engine MMEngine at the World Artificial Intelligence Conference on September 1, 2022. It is a foundational library for training deep learning models.

You can read the link for more details.

In short, there are two solutions: one is to use the dev-1.x branch of mmflow, and the other is to continue using the master branch but compile mmcv from source, because the corresponding version of mmcv has not yet provided precompiled packages for PyTorch 2.0.

  • Solution 1
# current directory is mmflow
pip install mmcv==2.0.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html
git remote add open-mmlab https://github.com/open-mmlab/mmflow.git
git fetch open-mmlab dev-1.x
git checkout dev-1.x
pip install -e . -v
  • Solution 2
git clone [email protected]:open-mmlab/mmcv.git
cd mmcv
git checkout 1.x
MMCV_WITH_OPS=1 pip install -e . -v

zhouzaida avatar Apr 10 '23 02:04 zhouzaida

Thank you for providing those solutions. Unfortunately, I couldn't make any of them work. Here is Google Colab file based on solution 1. Let me know if I am missing something.

Riponcs avatar Apr 13 '23 23:04 Riponcs

Any follow-ups about this issue? I am also focusing on the compatibility of mmcv and PyTorch 2.0

windless0530 avatar Aug 16 '23 06:08 windless0530