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

ValueError: zero component #24

Open
sjt-moon opened this issue Oct 24, 2018 · 6 comments
Open

ValueError: zero component #24

sjt-moon opened this issue Oct 24, 2018 · 6 comments

Comments

@sjt-moon
Copy link

Hi, I tested our pipeline providing with a single mesh, however, I encountered ValueError: Tried setting n_active_components to 0.985 - value needs to be a float 0.0 < n_components < self._total_kept_variance_ratio (nan) or an integer 1 < n_components < self.n_components (0).

My input contained 3 files with format .jpg, .mtl, .obj.

The log file is as follows:

Input directory provided - scanning for importable meshes
Found 1 input meshes under: input
Outputting results to /home/jingtao/lsfm/output


****** 1. DENSE CORRESPONDENCE **********

Correspondence: [==========] 100% (1/1) - done.


****** 1. INITIAL PCA + PRUNE **********

Allocated data matrix of size 1.22 MB (1 samples)
Building data matrix: [==========] 100% (1/1) - done.                           /home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo/math/decomposition.py:136: RuntimeWarning: invalid value encountered in true_divide
  C = np.dot(X, X.conj().T) / (n - 1)

Retaining 98.50% of eigenvalues keeps 0 components
/home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo/model/pca.py:322: RuntimeWarning: invalid value encountered in double_scalars
  return self._total_variance() / self.original_variance()
ance: 213.860

Input Error: Incorrect objective type.
 nbrpool statistics
        nbrpoolsize:            0   nbrpoolcpos:            0
    nbrpoolreallocs:            0

 Runtime parameters:
   Objective type: Unknown!
   Coarsening type: METIS_CTYPE_SHEM
   Initial partitioning type: METIS_IPTYPE_EDGE
   Refinement type: METIS_RTYPE_FM
   Perform a 2-hop matching: No
   Number of balancing constraints: 1
   Number of refinement iterations: 0
   Random number seed: 212860
   Number of separators: 21860
   Compress graph prior to ordering: Yes
   Detect & order connected components separately: No
   Prunning factor for high degree vertices: -126523184.000000
   Allowed maximum load imbalance: 213.860

Input Error: Incorrect objective type.
 nbrpool statistics
        nbrpoolsize:            0   nbrpoolcpos:            0
    nbrpoolreallocs:            0

 Runtime parameters:
   Objective type: Unknown!
   Coarsening type: METIS_CTYPE_SHEM
   Initial partitioning type: METIS_IPTYPE_EDGE
   Refinement type: METIS_RTYPE_FM
   Perform a 2-hop matching: No
   Number of balancing constraints: 1
   Number of refinement iterations: 0
   Random number seed: 212860
   Number of separators: 21860
   Compress graph prior to ordering: Yes
   Detect & order connected components separately: No
   Prunning factor for high degree vertices: -129997568.000000
   Allowed maximum load imbalance: 213.860

Input Error: Incorrect objective type.
 nbrpool statistics
        nbrpoolsize:            0   nbrpoolcpos:            0
    nbrpoolreallocs:            0

 Runtime parameters:
   Objective type: Unknown!
   Coarsening type: METIS_CTYPE_SHEM
   Initial partitioning type: METIS_IPTYPE_EDGE
   Refinement type: METIS_RTYPE_FM
   Perform a 2-hop matching: No
   Number of balancing constraints: 1
   Number of refinement iterations: 0
   Random number seed: 212860
   Number of separators: 21860
   Compress graph prior to ordering: Yes
   Detect & order connected components separately: No
   Prunning factor for high degree vertices: -129742136.000000
   Allowed maximum load imbalance: 213.860

Input Error: Incorrect objective type.
 nbrpool statistics
        nbrpoolsize:            0   nbrpoolcpos:            0
    nbrpoolreallocs:            0

Traceback (most recent call last):
  File "/home/jingtao/anaconda3/envs/lsfm/bin/lsfm", line 285, in <module>
    main(docopt(__doc__))
  File "/home/jingtao/anaconda3/envs/lsfm/bin/lsfm", line 281, in main
    pca_and_prune(r, verbose=verbose)
  File "/home/jingtao/anaconda3/envs/lsfm/bin/lsfm", line 100, in pca_and_prune
    verbose=True)
  File "/home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/lsfm/model.py", line 20, in pca_and_weights
    model.trim_components(retain_eig_cum_val)
  File "/home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo/model/pca.py", line 568, in trim_components
    self.n_active_components = n_components
  File "/home/jingtao/anaconda3/envs/lsfm/lib/python3.5/site-packages/menpo/model/pca.py", line 209, in n_active_components
    raise ValueError(err_str)
ValueError: Tried setting n_active_components to 0.985 - value needs to be a float 0.0 < n_components < self._total_kept_variance_ratio (nan) or an integer 1 < n_components < self.n_components (0)
@sjt-moon
Copy link
Author

Hi, I solved the above error. However, I get into another error. For bin/lsfm, line 78, c = landmark_and_correspond_mesh(mesh, verbose=verbose). Inside this function, mesh object is okay until running line 40: mesh_in_img = camera.apply(aligned_mesh). It seems that I should use specific img_shape for different images. Could you please shed some light on what img_shape is? Since it is not the pixel size of the input image, but a fixed number (320, 240). Thanks

@fcervon
Copy link

fcervon commented Mar 13, 2019

@sjt-moon, hi sorry to to bother you. I notice that you have passed the step "orrespondence: [==========] 100% (1/1) - done" where I'm stuck in. maybe you have the key file "balanced_frontal_face_aam_v0_py3.pkl".Can you share,Thank you 😊.

@sjt-moon
Copy link
Author

sjt-moon commented Mar 13, 2019 via email

@baymin182
Copy link

@sjt-moon, hi sorry to to bother you. I notice that you have passed the step "orrespondence: [==========] 100% (1/1) - done" where I'm stuck in. maybe you have the key file "balanced_frontal_face_aam_v0_py3.pkl".Can you share,Thank you .

hello, do you have the key file "balanced_frontal_face_aam_v0_py3.pkl" now?I face the same problem

@jabooth
Copy link
Member

jabooth commented Mar 20, 2019

I've just attempted to fix the server configuration for the static file - can you try the download again @fcervon/@baymin182?

@OlivierX
Copy link

Just one sample to capture PCs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants