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

debug 时会卡一下报 "no module named cv2" #44760

Closed
gglin001 opened this issue Aug 1, 2022 · 8 comments · Fixed by #51368
Closed

debug 时会卡一下报 "no module named cv2" #44760

gglin001 opened this issue Aug 1, 2022 · 8 comments · Fixed by #51368
Assignees
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/close 已关闭 type/bug-report 报bug

Comments

@gglin001
Copy link
Contributor

gglin001 commented Aug 1, 2022

bug描述 Describe the Bug

复现代码

demo.py

import paddle
import paddle.dataset.image

print(paddle.__version__)

如何复现

debug 上面的代码

复现结果

Screen Shot 2022-08-01 at 11 18 56 AM

原因

问题来自于这里

import_cv2_proc = subprocess.Popen([interpreter, "-c", "import cv2"],

其他补充信息 Additional Supplementary Information

No response

@paddle-bot
Copy link

paddle-bot bot commented Aug 1, 2022

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

@gglin001 gglin001 changed the title debug 时会卡一下报 "no module nasmed cv2" debug 时会卡一下报 "no module named cv2" Aug 1, 2022
@danleifeng
Copy link
Contributor

请问使用的是paddle 什么版本呢?在什么环境下使用呢?

@gglin001
Copy link
Contributor Author

gglin001 commented Aug 1, 2022

debug 分支, 手动编译的版本

@danleifeng
Copy link
Contributor

debug分支 是基于那个tag 或者branch呢?

@danleifeng
Copy link
Contributor

代码里 按理说对cv2做了一次判断,若返回值不为0,就不会import
image

@gglin001
Copy link
Contributor Author

gglin001 commented Aug 1, 2022

debug分支 是基于那个tag 或者branch呢?

用 2.3.1 relasae 的 wheel 似乎没有这个问题, 请问如何安装 nightly 的 wheel?

如何安装 nightly 的 wheel

见:
https://www.paddlepaddle.org.cn/

@gglin001
Copy link
Contributor Author

gglin001 commented Aug 1, 2022

可能和构建选项有关, 应该不是通常的问题, 会关闭这个 issue

@gglin001 gglin001 closed this as completed Aug 1, 2022
@paddle-bot paddle-bot bot added status/close 已关闭 and removed status/new-issue 新建 labels Aug 9, 2022
@luotao1 luotao1 added the PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc label Aug 15, 2022
@iamqiz
Copy link

iamqiz commented Dec 9, 2022

@danleifeng @gglin001 这是个大问题 ,虽然直接运行没问题, 但是debug时 那个 subprocess.Popen([interpreter, "-c", "import cv2"], 的错误会被debugger捕获到 , pycharm 和vscode 里debug都能复现 , 在pycharm里出现这个错误时,显示如下, 不仅很影响debug体验,而且小白很容易就以为是pycharm出了问题! (比如我,我搜了一下午百度google/jetbrains Youtrack找这个问题的解决方法,) 墙裂建议修复这个问题!
Snipaste_2022-12-09_21-22-00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/close 已关闭 type/bug-report 报bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants