Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'get_dist_info' from 'mmcv.runner.utils' #11

Closed
Varat7v2 opened this issue Apr 25, 2020 · 13 comments
Closed

Comments

@Varat7v2
Copy link

Varat7v2 commented Apr 25, 2020

When I run this command:
python tools/demo.py configs/elephant/cityperson/cascade_hrnet.py ./models_pretrained/epoch_5.pth.stu demo/ result_demo/

I am getting this error:
ImportError: cannot import name 'get_dist_info' from 'mmcv.runner.utils'

I have installed mmdetection as per your instructions and also tried for conda-instruction.

I updated mmcv as per the suggestions got online but nothing is working. Now my mmcv version is 0.4.4

@Varat7v2
Copy link
Author

I solved this issue by downgrading mmcv from 0.4.4 to 0.2.14 and the demo.py is running fine but there are no any bounding boxes on the result images.

@hasanirtiza
Copy link
Owner

hasanirtiza commented Apr 25, 2020

Which configuration file and pre-trained model did you use for the demo?

@Varat7v2
Copy link
Author

I am using the following configuration file and the pre-trained model:

configs/elephant/cityperson/cascade_hrnet.py
epoch_7.pth.stu
test images as provided in the demo folder

@hasanirtiza
Copy link
Owner

hasanirtiza commented Apr 25, 2020

How are you running epoch_7.pth.stu with the configuration of cascade_hrnet.py ? It seems to me that epoch_7.pth.stu is a pre-trained model for RetinaNet, not for the Cascade Mask R-CNN. Or did you train your own model ?

@Varat7v2
Copy link
Author

Varat7v2 commented Apr 28, 2020

Oh yeah! I did not notice that. I changed the config file with that of Retinanet and now its working. Thank you very much. If I want to run this model with SSD300 or RetinaNet on mobile devices or Jetson, will it run efficiently in regard of inference time? Now I am thinking of trying it on Jetson.

Also I was earlier trying running it on my PC without GPU but it was showing some cuda error: ImportError: cannot import name 'deform_conv_cuda' Won't it run only on CPU?

Thank you again.

@hasanirtiza
Copy link
Owner

As of now Pedestron does not support a CPU-only version. #7

@Varat7v2
Copy link
Author

Varat7v2 commented Apr 28, 2020

Okay thanks.

@zhulishun
Copy link

I solved this issue by downgrading mmcv from 0.4.4 to 0.2.14 and the demo.py is running fine but there are no any bounding boxes on the result images.

Hi~How to downgrading mmcv from 0.4.4 to 0.2.14 ?

@Varat7v2
Copy link
Author

Varat7v2 commented Jun 5, 2020

@zhulishun you can downgrade it with pip install mmcv==0.2.14

@zhulishun
Copy link

zhulishun commented Jun 5, 2020

@zhulishun you can downgrade it with pip install mmcv==0.2.14
thank u! I try, but
Pedestron$ pip install mmcv==0.2.14
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef88377c50>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/mmcv/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef88377be0>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/mmcv/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef883774e0>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/mmcv/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef88377390>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/mmcv/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fef88377240>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/mmcv/
ERROR: Could not find a version that satisfies the requirement mmcv==0.2.14 (from versions: none)
ERROR: No matching distribution found for mmcv==0.2.14

@hasanirtiza
Copy link
Owner

There seems to be a problem in your pip installation. This command should work
pip install mmcv==0.2.14
or
pip3 install mmcv==0.2.14
Depending upon your system. From the error log, it appears to me that you have some issues in your pip installation, have a look here or here.

@AdityaSrivastava1234
Copy link

Hi, I'm also facing the same issue while trying to do fine-tuning with cascade mask rcnn --> "ImportError: cannot import name 'get_dist_info' from 'mmcv.runner.utils' ". I'm following the colab notebook given by the authors which installs mmcv using the command --> "pip install mmcv==0.2.14". Still the problem persists. Please help me out, thanks in advance!

@hasanirtiza
Copy link
Owner

hasanirtiza commented Apr 26, 2022

Most probably it is still an installation issue, after installing mmcv did you compile Pedestron using the following command ?
python setup.py develop

Secondly, juts have a look at the installation page and see if you have followed all the instructions correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants