Detectron: AttributeError: 'module' object has no attribute 'ocl'

Created on 23 Jan 2018  ·  11Comments  ·  Source: facebookresearch/Detectron

When invoke this command:

python2 tools/infer_simple.py \
    --cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml \
    --output-dir /tmp/detectron-visualizations \
    --image-ext jpg \
    --wts https://s3-us-west-2.amazonaws.com/detectron/35861858/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml.02_32_51.SgT4y1cO/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl \
    demo

got this error:

Traceback (most recent call last):
  File "tools/infer_simple.py", line 51, in <module>
    cv2.ocl.setUseOpenCL(False)
AttributeError: 'module' object has no attribute 'ocl'

Most helpful comment

I compiled OpenCV 3.4 from source, and can confirm that this error was fixed by using OpenCV 3.4.

All 11 comments

Maybe you're using opencv 2?

Yes, I'm using OpenCV 2. Is it possible to disable OpenCV 2?

Detectron requires OpenCV 3 (version 3.12) that you can install using pip install opencv-python>=3.12. Please reopen if the error persists with the updated OpenCV version.

I compiled OpenCV 3.4 from source, and can confirm that this error was fixed by using OpenCV 3.4.

When i use the below command,i also got this error
$ pkg-config --modversion opencv
3.4.0

error:
Traceback (most recent call last):
File "tools/infer_simple.py", line 51, in
cv2.ocl.setUseOpenCL(False)
AttributeError: 'module' object has no attribute 'ocl'

my opencv version is opencv/3.3.0
and I got this error too
Traceback (most recent call last):
File "tools/infer_simple.py", line 51, in
cv2.ocl.setUseOpenCL(False)
AttributeError: 'module' object has no attribute 'ocl'

I don't know how to solve it ,is there anyone could help me ?

`

进入当前python环境

import cv2
cv2.__file__
`
得到'/usr/lib/python2.7/dist-packages/cv2.x86_64-linux-gnu.so'
在之前安装openbuild的build文件夹中的/lib/中

$ sudo mv cv2.x86_64-linux-gnu.so cv2.x86_64-linux-gnu.so.temple $ sudo ln -sf /software/opencv-3.4.0/build/lib/cv2.so cv2.x86_64-linux-gnu.so

Have you solved it, please?

This person is being turned in cyber crimes unit.

On Jan 24, 2018 9:37 PM, [email protected] wrote:

>

On Jan 24, 2018 5:00 AM, "Yili Zhao" notifications@github.com wrote:

I compiled OpenCV 3.4 from source, and can confirm that this error was
fixed by using OpenCV 3.4.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/facebookresearch/Detectron/issues/8#issuecomment-360079893,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AiGmCkwBlXpOGGMCOqszr3CkPJrLCoUTks5tNv8qgaJpZM4Rpp9-
.

--
null

---------- Forwarded message ----------
From: Mk Deacon deadmilkman7@gmail.com
Date: Wednesday, January 24, 2018
Subject: Hacking me !!!!
To: [email protected]

You just helped a criminal to shut down my accounts! I have spent months
tracking this person.No my google and facebook have already been taken.

--
null

I installed opencv use
conda install --channel https://conda.anaconda.org/menpo opencv3
conda install --channel https://conda.anaconda.org/menpo opencv

so , Where can I find the build/lib file.
and my cv2.__file__ output '/home/kk/anaconda2/envs/py2caffe2/lib/python2.7/site-packages/cv2.so

Was this page helpful?
0 / 5 - 0 ratings

Related issues

partnercloudsupport picture partnercloudsupport  ·  3Comments

rbgirshick picture rbgirshick  ·  3Comments

olgaliak picture olgaliak  ·  4Comments

coldgemini picture coldgemini  ·  3Comments

fangpengcheng95 picture fangpengcheng95  ·  4Comments