Open hugos94 opened 7 years ago
@jacobgil I can confirm.
Here is the main code modification I made before encountering this issue.
em = cv2.ml.EM_create()
em.setClustersNumber(N)
em.trainEM(descriptors)
return np.float32(em.getMeans()), np.float32(em.getCovs()), np.float32(em.getWeights())[0]
What is 'pdf' in line 38 'gaussians[index] = np.array([g_k.pdf(x) for g_k in g])' ????? I can't find the function @hendrycks @hugos94 @ @jacobgil
@hugos94 hi sorry to bother you .how you solve the problem numpy.linalg.linalg.LinAlgError: singular matrix
@jacobgil I can confirm.
Here is the main code modification I made before encountering this issue.
em = cv2.ml.EM_create() em.setClustersNumber(N) em.trainEM(descriptors) return np.float32(em.getMeans()), np.float32(em.getCovs()), np.float32(em.getWeights())[0]
i have tired to implement this modification but is showing error in em.trainEM(descriptors)
TypeError: ml_StatModel.train() missing required argument 'layout' (pos 2)
If you have got this solution please share. Thank you
I am using the latest version of opencv and several functions have been modified. I adapted the code to work with the current version, however, when function
g = [multivariate_normal(mean=means[k], cov=covs[k]) for k in range(0, len(weights)) ]
is applied the following error is returned:numpy.linalg.linalg.LinAlgError: singular matrix
.I know that some function is returning a singular matrix, which makes it impossible to apply the function multivariate_normal.
What should I do? I'm really needing FisherVector applied to the Bag Of Words, and that was the only implementation I found.
Sorry for the bad english and thanks for the help.