opencv3.1 on windows. object has no attribute 'MinDistancePredictCollector' - python

I'm using OpenCV3.1 with python27 on Windows 7 for face recognition. I compile the OpenCV 3.1 and the opencv_contrib modules using CMAKE and VS Express 2012 with all teh required stuff. Until I reach to the last part, which is for the collector to calculate the matching picture to the database or more specifically this line:
collector = cv2.face.MinDistancePredictCollector()
and outputting this error:
AttributeError: 'module' object has no attribute 'MinDistancePredictCollector'

Refer to #DanMasek reply on my question. Which is to download the proper module tag 3.1.0 and recompile it. problem solved.

Related

AttributeError: 'gdstk.Cell' object has no attribute 'get_polygons'

I am new in PIC design and I want to make a simple GDSII design following this script:
https://github.com/BYUCamachoLab/simphony/blob/master/examples/layout_aware.py
which uses gdsfactory and simphony libraries but I consistently encounter this error when I am building a cell:
AttributeError: 'gdstk.Cell' object has no attribute 'get_polygons'
This problem appears when I try to call the grating coupler or the waveguides as a component. On the other hand, the Ybranch (splitters) work just fine.
I have downloaded all the latest versions of gdstk, gdsfactory and simphony but cannot make it work.
Do you know how to overcome this issue? What am I missing?
Thanks!
Solved. In case anybody finds in the same situation, the problem was with the gdstk library. For whatever reason, the version installed could not be changed and it remained always in 7.0.
By reinstalling Anaconda, the gdstk latest version could be installed without issues, and from there the program worked.

I got a trio input function from a friend and it's trying to use trio.lowleve.FdStream, however I can't find it

I'm getting this error: AttributeError: module 'trio.lowlevel' has no attribute 'FdStream'. FdStream isn't in the trio code on git nor in my installation. Is there an alternative to this, or is there a different version I did't find?
That attribute is only available on non-Windows platforms. If your friend made the function compatible with only Linux/macos, you will need to run the function on a Posix platform as well.

Cannot Unpickle my model after Reinstalling Python

I used pickle for a few months to save my ML-models and was able to load them without any problems but recently after Reinstalling Windows and Python I am getting this error message when I try to load the exact same model:
AttributeError: type object 'sklearn.neighbors.ball_tree.NeighborsHeap' has no attribute '__reduce_cython__'
Does anyone know what is causing this?
I used Python 3.6 (64bit) before and I am using the same one right now.
Most probably, you are using a different version of sklearn.
According to search results for __reduce_cython__ in Cython's codebase, it's added by Cython to some compiled types to make __reduce__ work correctly or something. So its absense likely means changes in the affected classes or their hierarchy.

Python interpreter can't find face module although it is in the build directory of Opencv 3.0.0

I was reading this tutorial and when I tried to run the attached face recognizer python code
it gave me the following error :
AttributeError: 'module' object has no attribute 'face'
I am on ubuntu 15.04, I have python 2.7, numpy, matplotlib and PIL installed and updated.
I pulled the latest sources of opencv from http://github.com/itseez/openc..., compiled according to the documentation.I added the latest source of opencv contrib from https://github.com/Itseez/open..., compiled according to the documentation.
To make sure:
I have the python bindings i typed the following in the python shell:
import cv2
cv2.version
it returned the following '3.0.0'
The face module folder already in the modules folder in the build directory
I modified the original code with my recent images database directory and haarcascade xml file and
recognizer = cv2.createLBPHFaceRecognizer()
to be
recognizer = cv2.face.createLBPHFaceRecognizer()
When i tried to run type
import cv2
help(cv2.face)
it returned the following error AttributeError: 'module' object has no attribute 'face'
When I tried to explore this file: build/modules/python2/pyopencv_generated_types.h I found that:
pyopencv_face_BasicFaceRecognizer_Type.tp_base = &pyopencv_face_FaceRecognizer_Type; pyopencv_face_LBPHFaceRecognizer_Type.tp_base = &pyopencv_face_FaceRecognizer_Type;
I googled extensively to find a solution and I tried all the available solutions but still stuck at the same point. AttributeError: 'module' object has no attribute 'face'
The last activity about the similar questions was from 7 month ago so I re-ask this question to figure out if there are new answers about this issue.
What should I do?

Python GTK AttributeError: 'gi.repository.Gtk' object has no attribute 'FlowBox'

I am following Python GTK3+ Tutorial to make some applications on Ubuntu. However, when I try to execute sample code given for FLowBox, it results into following error:
AttributeError: 'gi.repository.Gtk' object has no attribute 'FlowBox'
I have GTK3 (v3.10.8) installed as well as Python 2.7.6 and Python 3.4.0.
I'm using Ubuntu 14.04
What should I do ?
GtkFlowBox was introduced in GTK+ 3.12. You will either need to: a) find a way to upgrade your GTK+ packages (there might be a PPA for that; check the Ubuntu GNOME team's Launchpad), b) upgrade to Ubuntu 14.10, or c) refer to an older version of the tutorial (I don't know how to find that).

Categories

Resources