MPI-IS / mesh

MPI-IS Mesh Processing Library
Other
643 stars 147 forks source link

TypeError issue in mesh library #24

Closed minyoung-mia-Kim closed 4 years ago

minyoung-mia-Kim commented 4 years ago

Hi,

I've tried to test CoMA source code(pytorch version) and I nearly got this, but finally met a library issue I couldn't find any solution.

The error is... TypeError: argument 1 must be numpy.ndarray, not numpy.ndarray

I've got this while running below and when I run the test code the library seems not to be able to load meshes properly.

run main.py --data_dir /data --checkpoint_dir /checkpoints (this is from CoMA code)

/opt/conda/envs/py355/lib/python3.5/site-packages/psbody/mesh/mesh.py in compute_aabb_tree(self) 438 439 def compute_aabb_tree(self): --> 440 return search.AabbTree(self) 441 442 def compute_aabb_normals_tree(self):

/opt/conda/envs/py355/lib/python3.5/site-packages/psbody/mesh/search.py in init(self, m) 22 from . import spatialsearch 23 # this shit return NULL ---> 24 self.cpp_handle = spatialsearch.aabbtree_compute(m.v.astype(np.float64).copy(order='C'), m.f.astype(np.uint32).copy(order='C')) 25 26 def nearest(self, v_samples, nearest_part=False):

TypeError: argument 1 must be numpy.ndarray, not numpy.ndarray

Please give me some help... I opened this issue at pytorch_coma repo too.

Thank you in advanced

wlhsiao commented 4 years ago

I'm not the author of this repo, but met the same error and solved it by reinstalling this mesh package. Did you run make tests when you first install this? I did make tests when I first installed this package and there were no error messages. However, after I continue to install more packages like opendr, chumpy, sklearn, ... etc., when I run make tests again, I start getting the same type error at the same line of code as yours: TypeError: argument 1 must be numpy.ndarray, not numpy.ndarray As a result, I decided to reinstall my mesh package, did make tests, run my program that depends on mesh, and this error no longer persists. For my case, I think this error probably comes from incorrect package versions introduced by packages I later installed, so reinstalling mesh with the correct package versions helped. Just for your reference, and hope you solve yours, too!

jcpassy commented 4 years ago

Hi @mia-minyoung, thanks for submitting your issue, and thanks @wlhsiao for contributing. I assume that you are using this COMA repository. I agree with @wlhsiao that it sounds like like an incompatibility between packages versions. I see that you are using conda and it might be the reason for your trouble. This is why I advise you to use the system python instead. If you still encounter issues, let us know and we will try to help.

Cheers!