How to fix ? #1710
Unanswered
sinyoung-park
asked this question in
General
How to fix ?
#1710
Replies: 1 comment 1 reply
-
Have you tried to reinstall OpenCV? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi, i'm using colab. and the colab ,the colab is using python3.10.
i want use Grad-CAM. and i read the document the Grad-CAM and i modify code.
!pip install "grad-cam">=1.3.6
!python tools/visualization/vis_cam.py
/content/mmpretrain/pcldata/potentialcore230522/test_set/class_16slm/16slm_3002.png
/content/mmpretrain/configs/resnet/resnet34_8xb32_in1k_custom.py
/content/mmpretrain/resnet34_8xb32_in1k_custom/epoch_25.pth
--target-layers='backbone.layer3.4.relu'
--method='GradCAM'
but. the reuslt is Loads checkpoint by local backend from path: /content/mmpretrain/resnet34_8xb32_in1k_custom/epoch_25.pth
Automatically choose the last norm layer "backbone.layer4.2.bn2" as the target layer.
QObject::moveToThread: Current thread (0xf30eea0) is not the object's thread (0xc2a16e0).
Cannot move to target thread (0xf30eea0)
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/lib/python3.10/dist-packages/cv2/qt/plugins" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: xcb.
and i found the /usr/local/lib/python3.10/dist-packages/cv2/qt/plugins path. but the libqxcb.sofile is not existed.
so i run this code.
import shutil
import os
cv2_path = os.path.dirname(cv2.file)
plugin_path = os.path.join(cv2_path, "qt", "plugins")
platform_path = os.path.join(plugin_path, "platforms")
os.makedirs(platform_path, exist_ok=True)
shutil.copy("/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so", platform_path)
and the result is /usr/local/lib/python3.10/dist-packages/cv2/qt/plugins/platforms/libqxcb.so .
so i think i solve this problem. but the code is still have same error. how can i do? please help me.
Beta Was this translation helpful? Give feedback.
All reactions