menpo / lsfm

Large Scale Facial Model (LSFM) - an automatic pipeline for constructing 3D Morphable Models from large collections of facial meshes
http://ibug.doc.ic.ac.uk/resources/lsfm/
BSD 3-Clause "New" or "Revised" License
504 stars 117 forks source link

ValueError: zero component #24

Open sjt-moon opened 6 years ago

sjt-moon commented 6 years ago

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 commented 6 years ago

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 commented 5 years ago

@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 commented 5 years ago

Hi,

I'm sorry I haven't been focus on this topic for a while and I'm afraid I forget the details. Maybe you can check to see if the variance is NaN. Good luck.

sjt-moon

fcervon notifications@github.com 于2019年3月12日周二 下午8:04写道:

@sjt-moon https://github.com/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 😊.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/menpo/lsfm/issues/24#issuecomment-472261186, or mute the thread https://github.com/notifications/unsubscribe-auth/AaxyTA_FRI1a3ASEUPXjT0pr7Lf_48fuks5vWGqlgaJpZM4X4lRz .

baymin182 commented 5 years ago

@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 commented 5 years ago

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

OlivierX commented 5 years ago

Just one sample to capture PCs?