mmdetection icon indicating copy to clipboard operation
mmdetection copied to clipboard

Error in the demos with Google Colab

Open antoineedy opened this issue 1 year ago • 5 comments

Some (all?) demos do not work anymore on Google Colab.

To reproduce: Open any demo in the demo folder, like this one.

Open in Google Colab and run the file. The third output cell is the following:

AssertionError                            Traceback (most recent call last)
<ipython-input-3-a857150f8e0e> in <cell line: 4>()
      2 from mmengine.utils.dl_utils import collect_env as collect_base_env
      3 
----> 4 import mmdet
      5 
      6 

/content/mmdetection/mmdet/__init__.py in <module>
     15 
     16 assert (mmcv_version >= digit_version(mmcv_minimum_version)
---> 17         and mmcv_version < digit_version(mmcv_maximum_version)), \
     18     f'MMCV=={mmcv.__version__} is used but incompatible. ' \
     19     f'Please install mmcv>={mmcv_minimum_version}, <{mmcv_maximum_version}.'

AssertionError: MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.2.0.

This error does not match the !mim install "mmcv>=2.0.0rc4" of the cell above. I tried with changing the version of mmcv to one between 2.0.0rc4 & 2.2.0, but the same error keeps occurring.

antoineedy avatar May 06 '24 13:05 antoineedy

This is my problem also

mahao18cm avatar May 31 '24 06:05 mahao18cm

for colab, you may try to run !mim install mmdet to install mmdet straight away; for terminal, you may try mim install mmdet. Seems like it'll help to reinstall the suitable mmcv (2.1.0 for my case). This works for me

pf0418 avatar Jun 04 '24 07:06 pf0418

Exactly! I also tried this way and subsequently successed. But what embarrassed me is the time of building wheel for this. I almost thought that i was wrong but the result is fine.Thank for you emails.

------------------ 原始邮件 ------------------ 发件人: "open-mmlab/mmdetection" @.>; 发送时间: 2024年6月4日(星期二) 下午3:27 @.>; @.@.>; 主题: Re: [open-mmlab/mmdetection] Error in the demos with Google Colab (Issue #11684)

for colab, you may try to run !mim install mmdet to install mmdet straight away; for terminal, you may try mim install mmdet. Seems like it'll help to reinstall the suitable mmcv (2.1.0 for my case). This works for me

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

mahao18cm avatar Jun 04 '24 07:06 mahao18cm

You can also set the version directly for mmcv

!mim install "mmcv==2.0.0rc4"

abozanona avatar Jun 04 '24 10:06 abozanona

I found a weird solution, when doing following step, it's works !git clone https://github.com/open-mmlab/mmdetection.git !cd mmdetection && pip install -e .

here is a little bit weird things to do, goto mmdetection/mmdet/init.py, change mmcv_maximum_version = '2.2.0' to mmcv_maximum_version = '2.2.1' and run below again

!cd mmdetection && pip install -e .

zivzone avatar Oct 15 '24 10:10 zivzone