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 '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) #3837

Open
ououch123 opened this issue Jan 19, 2025 · 0 comments

Comments

@ououch123
Copy link

Thanks for your error report and we appreciate it a lot.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. The bug has not been fixed in the latest version.

Describe the bug
A clear and concise description of what the bug is.

D:\SoftWare\anaconda3\envs\mmsegmentation\python.exe F:\GaoFen\mmsegmentation\demo\image_demo.py F:\GaoFen\mmsegmentation\demo\demo.png F:\GaoFen\mmsegmentation\configs\pspnet\pspnet_r50-d8_4xb2-40k_cityscapes-512x1024.py D:\Download\pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth --device cuda:0 --out-file result.jpg
D:\SoftWare\anaconda3\envs\mmsegmentation\lib\site-packages\mmengine\logging\history_buffer.py:5: UserWarning: The NumPy module was reloaded (imported a second time). This can in some cases result in small but subtle issues and is discouraged.
import numpy as np
F:\GaoFen\mmsegmentation\mmseg\models\losses\cross_entropy_loss.py:250: UserWarning: Default avg_non_ignore is False, if you would like to ignore the certain label and average loss over non-ignore labels, which is the same with PyTorch official cross_entropy, set avg_non_ignore=True.
warnings.warn(
Loads checkpoint by local backend from path: D:\Download\pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth
D:\SoftWare\anaconda3\envs\mmsegmentation\lib\site-packages\mmengine\visualization\visualizer.py:196: UserWarning: Failed to add <class 'mmengine.visualization.vis_backend.LocalVisBackend'>, please provide the save_dir argument.
warnings.warn(f'Failed to add {vis_backend.class}, '
Traceback (most recent call last):
File "F:\GaoFen\mmsegmentation\demo\image_demo.py", line 51, in
main()
File "F:\GaoFen\mmsegmentation\demo\image_demo.py", line 38, in main
show_result_pyplot(
File "F:\GaoFen\mmsegmentation\mmseg\apis\inference.py", line 170, in show_result_pyplot
visualizer = SegLocalVisualizer(
File "F:\GaoFen\mmsegmentation\mmseg\visualization\local_visualizer.py", line 77, in init
super().init(name, image, vis_backends, save_dir, **kwargs)
File "D:\SoftWare\anaconda3\envs\mmsegmentation\lib\site-packages\mmengine\visualization\visualizer.py", line 212, in init
self.ax_save) = self._initialize_fig(fig_save_cfg)
File "D:\SoftWare\anaconda3\envs\mmsegmentation\lib\site-packages\mmengine\visualization\visualizer.py", line 327, in initialize_fig
from matplotlib.backends.backend_agg import FigureCanvasAgg
File "D:\SoftWare\anaconda3\envs\mmsegmentation\lib\site-packages\matplotlib_init
.py", line 161, in
from . import _api, _version, cbook, _docstring, rcsetup
File "D:\SoftWare\anaconda3\envs\mmsegmentation\lib\site-packages\matplotlib\cbook.py", line 32, in
from matplotlib import _api, _c_internal_utils
ImportError: cannot import name 'c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (D:\SoftWare\anaconda3\envs\mmsegmentation\lib\site-packages\matplotlib_init.py)

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

1 participant