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 'force_fp32' from 'mmcv.runner' #19

Open
Lixia1221 opened this issue May 17, 2021 · 4 comments
Open

ImportError: cannot import name 'force_fp32' from 'mmcv.runner' #19

Lixia1221 opened this issue May 17, 2021 · 4 comments

Comments

@Lixia1221
Copy link

(open-mmlab) fsr@titanxp:~/FoveaBox-01$ python tools/train.py configs/foveabox/fovea_r50_fpn_gfl.py
Traceback (most recent call last):
File "tools/train.py", line 9, in
from mmdet.apis import (get_root_logger, init_dist, set_random_seed,
File "/home/fsr/FoveaBox-01/mmdet/apis/init.py", line 2, in
from .inference import (inference_detector, init_detector, show_result,
File "/home/fsr/FoveaBox-01/mmdet/apis/inference.py", line 13, in
from mmdet.models import build_detector
File "/home/fsr/FoveaBox-01/mmdet/models/init.py", line 1, in
from .anchor_heads import * # noqa: F401,F403
File "/home/fsr/FoveaBox-01/mmdet/models/anchor_heads/init.py", line 10, in
from .gfl_head import Integral, GFLHead
File "/home/fsr/FoveaBox-01/mmdet/models/anchor_heads/gfl_head.py", line 5, in
ImportError: cannot import name 'force_fp32' from 'mmcv.runner' (/home/fsr/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/init.py)

@limeranceofyyqx
Copy link

我也遇到了相同的问题,请问您解决了吗?

@zhangkai07
Copy link

I have same question,
My envs is mmcv 2.0.0+cu11.8+torch2.1
I think this is a version problem, but I cannot solve it

@johnson-magic
Copy link

johnson-magic commented Jun 16, 2023 via email

@llelio272
Copy link

I use the "from mmcv.runner.fp16_utils import force_fp32" to replace "from mmcv.runner import force_fp32", and the problem solved.

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

5 participants