vita-epfl / openpifpaf

Official implementation of "OpenPifPaf: Composite Fields for Semantic Keypoint Detection and Spatio-Temporal Association" in PyTorch.
https://arxiv.org/abs/2103.02440
Other
80 stars 22 forks source link

when i try to run v0.14.0 from source code, it raise ImportError. #4

Closed KingArtherTT closed 2 years ago

KingArtherTT commented 2 years ago

I clone the source code from github, then i want to run the openpifpaf/src/openpifpaf/predict.py file.And it raise error.I tracked down the issue and found that the error came from cpp_extension.register_ops()

extfinder = importlib.machinery.FileFinder(lib_dir, loader_details) ext_specs = extfinder.find_spec("_cpp") if ext_specs is None: raise ImportError

It needs some openpifpaf._cpp files where i found in setup.py. I want to run from the source code, and i do not know how to build this openpifpaf._cpp file,please help!!

KingArtherTT commented 2 years ago

I already fixed it. you need run the following command and manually specify the path of _cpp.so file . 1. python setup.py build 2. python setup.py install

  1. check the _cpp.so file path and remember it.
  2. set the code in cpp_extension.py file
  3. lib_dir = 'the path of your _cpp.so file'