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

Python dlib module has no image_window attribute? #7

Closed
gstro opened this issue Feb 25, 2015 · 26 comments

Comments

Projects
None yet
@gstro
Copy link

commented Feb 25, 2015

Hi! Thanks for making a Python API for dlib -- I'm excited to try it out (once I get it working)!

I compiled the examples today and tried to run train_object_detector.py but it gave the following error:

File "train_object_detector.py", line 95, in <module>
    win_det = dlib.image_window()
AttributeError: 'module' object has no attribute 'image_window'

I get the same error from the Python interpreter:

$ python
Python 2.7.9 (default, Jan 18 2015, 00:53:20) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import dlib
>>> window = dlib.image_window()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'image_window'
>>>

I'm on OS X 10.10.2. Any help you can offer would be greatly appreciated.

@gstro

This comment has been minimized.

Copy link
Author

commented Feb 25, 2015

Deleted examples build and recompiled, and now I can't recreate the error. Not quite through the woods but I don't think this is an issue anymore.

@gstro gstro closed this Feb 25, 2015

@davisking

This comment has been minimized.

Copy link
Owner

commented Feb 26, 2015

Sweet :)

@vasekjares

This comment has been minimized.

Copy link

commented May 9, 2015

Same issue, recompiled several times and still can't find solution. OS X 10.10.2

@davisking

This comment has been minimized.

Copy link
Owner

commented May 9, 2015

What error did you get?

@vasekjares

This comment has been minimized.

Copy link

commented May 9, 2015

Hi,
thank you for quick reaction!
I don't get any errors. But if I use pydoc on compiled package, there is no class image_window.
array
cca_outputs
fhog_object_detector
full_object_detection
matrix
pair
point
points
range
ranges
rangess
ranking_pair
ranking_pairs
rectangle
rectangles
rgb_pixel
segmenter_params
segmenter_test
segmenter_type
shape_predictor
shape_predictor_training_options
simple_object_detector
simple_object_detector_training_options
simple_test_results
sparse_ranking_pair
sparse_ranking_pairs
sparse_vector
sparse_vectors
sparse_vectorss
svm_c_trainer_histogram_intersection
svm_c_trainer_linear
svm_c_trainer_radial_basis
svm_c_trainer_sparse_histogram_intersection
svm_c_trainer_sparse_linear
svm_c_trainer_sparse_radial_basis
svm_rank_trainer
svm_rank_trainer_sparse
vector
vectors
vectorss

I'm using commands from python_examples/compile_dlib_python_module.bat. And I get this:
Linking CXX static library libdlib.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdlib.a(sockets_kernel_1.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdlib.a(dir_nav_kernel_1.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdlib.a(threads_kernel_1.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdlib.a(stack_trace.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdlib.a(sockets_kernel_1.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdlib.a(dir_nav_kernel_1.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdlib.a(threads_kernel_1.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libdlib.a(stack_trace.o) has no symbols

Should it cause that problem?
Thanks!

@davisking

This comment has been minimized.

Copy link
Owner

commented May 9, 2015

Those warnings about not having symbols are fine. The issue is probably that it didn't find libx11 on your machine, which is required to use the GUI components. When you initially ran the script it should have output a message saying that it didn't find X11 and that you need to install XQuartz. If you do that then it should work.

@vasekjares

This comment has been minimized.

Copy link

commented May 11, 2015

Thanks! Installing libx11 solved problem.

@jin10086

This comment has been minimized.

Copy link

commented Nov 6, 2016

@davisking
My computer system is windows7, have the same error.
How should I do it?
Thanks!

@davisking

This comment has been minimized.

Copy link
Owner

commented Nov 6, 2016

You don't need X11 on windows, unless you are trying to compile in something like cygwin.

@jin10086

This comment has been minimized.

Copy link

commented Nov 6, 2016

@davisking
How do I solve this problem?
.....

@davisking

This comment has been minimized.

Copy link
Owner

commented Nov 6, 2016

@jin10086

This comment has been minimized.

Copy link

commented Nov 7, 2016

i use "conda install -c menpo dlib=18.18" in windows 7 64+py27
and tried to run face_landmark_detection.py but it gave the following error:
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
D:\Users\e069383\Desktop\notebook\py\face_landmark_detection.py in ()
65 detector = dlib.get_frontal_face_detector()
66 predictor = dlib.shape_predictor(predictor_path)
---> 67 win = dlib.image_window()
68
69 for f in glob.glob(os.path.join(faces_folder_path, "*.jpg")):

AttributeError: 'module' object has no attribute 'image_window'
`

@davisking

This comment has been minimized.

Copy link
Owner

commented Nov 7, 2016

@jin10086

This comment has been minimized.

Copy link

commented Nov 11, 2016

i use "conda install -c conda-forge dlib=19.0"
in windows 7 64 py27 can work

@dmittal5

This comment has been minimized.

Copy link

commented May 16, 2017

hi, I have been trying to run face detection file in python on ubuntu. but there is the following error -
Traceback (most recent call last):
File "/home/divya/proj/detect.py", line 9, in
face_detector = dlib.get_frontal_face_detector()
AttributeError: 'module' object has no attribute 'get_frontal_face_detector'

please help!

@abhisheksoni27

This comment has been minimized.

Copy link

commented Aug 2, 2017

I have libx11-dev installed on my machine, but I am still getting the same error. Anything else I might check?

@davisking

This comment has been minimized.

Copy link
Owner

commented Aug 2, 2017

The compile process prints messages telling you what it's doing. It will announce if it found X11 or not.

@abhisheksoni27

This comment has been minimized.

Copy link

commented Aug 2, 2017

It does find libx11.so

@jorgher

This comment has been minimized.

Copy link

commented Aug 10, 2017

All dependencies installed (X11, Boost, Boos.Python, ..)
(opencv) jorgher@jorgher-Lenovo-G575: conda install -c menpo dlib
(opencv) jorgher@jorgher-Lenovo-G575:~/Documents/dlib/python_examples$ python face_detector.py ../examples/faces/*.jpg
Traceback (most recent call last):
File "face_detector.py", line 52, in
win = dlib.image_window()
AttributeError: module 'dlib' has no attribute 'image_window'

pls help

@CHENCHAOQI

This comment has been minimized.

Copy link

commented Aug 11, 2017

I meet the same problem,and I follow some instruction,but I meet new problem,it is:Illegal instruction (core dumped).
How can I solve it?

@pawanvirsingh

This comment has been minimized.

Copy link

commented Oct 8, 2017

same with me

import dlib
import skimage
impface_detector = dlib.get_frontal_face_detector()

face_detector = dlib.get_frontal_face_detector()
win = dlib.image_window()
Traceback (most recent call last):
File "", line 1, in
AttributeError: module 'dlib' has no attribute 'image_window'

on ubuntu pls help if someone did before

@davisking

This comment has been minimized.

Copy link
Owner

commented Oct 8, 2017

@DyLanCao

This comment has been minimized.

Copy link

commented Nov 24, 2017

on ubuntu . I forget to run the commond on dlib root: python setup.py install

@bhomass

This comment has been minimized.

Copy link

commented Apr 19, 2018

I installed xquartz on my mac. I also reinstalled dlib, but still I am getting
AttributeError: module 'dlib' has no attribute 'image_window'

Anything else I should be beside install xquartz?

@davisking

This comment has been minimized.

Copy link
Owner

commented Apr 20, 2018

That should be all. Make sure you really are recompiling dlib. Delete everything and redownload.

@bhomass

This comment has been minimized.

Copy link

commented Jul 7, 2018

yes, rebuild c++ from scratch, then python setup.py install inside my conda env. Finally, it's running. conda install -c menpo dlib does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.