Tf-pose-estimation: What happened to my program caused me not to proceed? from estimator import TfPoseEstimator ImportError: cannot import name 'pafprocess'

Created on 29 May 2018  ·  16Comments  ·  Source: ildoonet/tf-pose-estimation

(tfpose) C:Userslim_l_000Desktoptf-openpose>python src/run_webcam.py --model=mobilenet_thin_432x368 --camera=0
Traceback (most recent call last):
File "src/run_webcam.py", line 8, in
from estimator import TfPoseEstimator
File "C:Userslim_l_000Desktoptf-openposesrcestimator.py", line 5, in
from pafprocess import pafprocess
ImportError: cannot import name 'pafprocess'

Most helpful comment

@siddharthrajpatel Hi bro! I've someway managed this error by replacing (in pafprocess.cpp file) all "or" with "||" and all "and" with "&&". Also it need to change the round function name (i've named it as "rounds") beacuse it collides with cmath round function. Now you have just to run "swig -python -c++ pafprocess.i && python setup.py build_ext --inplace " and it will compile. Then should work everything (hope it!).

(On Windows 10 Os)

All 16 comments

please compile pafprocess first with swig inside the srf/pafprocess folder

can teach me how to do it ...?
I am a beginner...
u mean is install swig ?

hi @ouceduxzk , @RitvikMandyam i have run the command in the srcpafprocess location:

swig -python -c++ pafprocess.i && python3 setup.py build_ext --inplace
but it shows the following error:

pa

can you please help?

I did that but it still has problems .....

(tfpose) C:Userslim_l_000Desktoptf-pose2tf_posepafprocess>swig -python -c++ pafprocess.i && python setup.py build_ext --inplace
running build_ext
building '_pafprocess' extension
swigging pafprocess.i to pafprocess_wrap.cpp
C:Program Filesswigwin-3.0.12swig.exe -python -c++ -o pafprocess_wrap.cpp pafprocess.i
error: Unable to find vcvarsall.bat

@siddharthrajpatel Hi bro! I've someway managed this error by replacing (in pafprocess.cpp file) all "or" with "||" and all "and" with "&&". Also it need to change the round function name (i've named it as "rounds") beacuse it collides with cmath round function. Now you have just to run "swig -python -c++ pafprocess.i && python setup.py build_ext --inplace " and it will compile. Then should work everything (hope it!).

(On Windows 10 Os)

@zerolim820
faced the same problem...

(tfpose) C:Userslim_l_000Desktoptf-pose2tf_posepafprocess>swig -python -c++ pafprocess.i && python setup.py build_ext --inplace
running build_ext
building '_pafprocess' extension
swigging pafprocess.i to pafprocess_wrap.cpp
C:Program Filesswigwin-3.0.12swig.exe -python -c++ -o pafprocess_wrap.cpp pafprocess.i
error: Unable to find vcvarsall.bat

Try installing Visual Studio. If my memory serves, vcvarsall.bat is part of the VS package.

I tried that ,still showing that error

@riccardoPalumbo96 thanks, now the swig code is running :)

This error always occurs.

(tfpose) C:Users15029Desktoptf-openposetf_posepafprocess>swig -python -c++ pafprocess.i && python setup.py build_ext --inplace
running build_ext
building '_pafprocess' extension
swigging pafprocess.i to pafprocess_wrap.cpp
C:Users15029Anaconda3Librarybinswig.exe -python -c++ -o pafprocess_wrap.cpp pafprocess.i
error: Unable to find vcvarsall.bat

Try to compile directly from Visual Studio Prompt
This could be useful: https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/

Thx. i reinstalled Visual Studio2017 and solved the problem.

@yinan-1 when you reinstall VS2017, are u repeat all commands ?

No, I'm just missing the C++ environment.

发件人: Omar El Manssouri
发送时间: 2018年10月28日 5:39
收件人: ildoonet/tf-pose-estimation
抄送: yinan-1; Mention
主题: Re: [ildoonet/tf-pose-estimation] What happened to my program causedme not to proceed? from estimator import TfPoseEstimator ImportError: cannotimport name 'pafprocess' (#191)

@yinan-1 when you reinstall VS2017, are u repeat all commands ?

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Hi,
I got problem when running command of either "python run_webcam.py --model=mobilenet_thin --resize=432x368 --camera=0" or "python3 run_webcam.py --model=mobilenet_thin --resize=432x368 --camera=0"

Error shown below when set root to run tf-pose:
"root@ired-IdeaPad-L340-15IRH-Gaming:/Downloads/tf-pose-estimation-master# python run_webcam.py --model=mobilenet_thin --resize=432x368 --camera=0
Traceback (most recent call last):
File "run_webcam.py", line 8, in
from tf_pose.estimator import TfPoseEstimator
File "/home/ired/Downloads/tf-pose-estimation-master/tf_pose/init.py", line 5, in
from tf_pose.runner import infer, Estimator, get_estimator
File "/home/ired/Downloads/tf-pose-estimation-master/tf_pose/runner.py", line 5, in
from functools import lru_cache
ImportError: cannot import name lru_cache
root@ired-IdeaPad-L340-15IRH-Gaming:/Downloads/tf-pose-estimation-master# python3 run.py --model=mobilenet_thin --resize=432x368 --image=./images/p1.jpg
Traceback (most recent call last):
File "run.py", line 6, in
from tf_pose import common
File "/home/ired/Downloads/tf-pose-estimation-master/tf_pose/init.py", line 5, in
from tf_pose.runner import infer, Estimator, get_estimator
File "/home/ired/Downloads/tf-pose-estimation-master/tf_pose/runner.py", line 4, in
import cv2
ModuleNotFoundError: No module named 'cv2'"

Could anyone tell me how to fix it please?
Thanks, Francis

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomercohen11 picture tomercohen11  ·  6Comments

juciny picture juciny  ·  3Comments

gen21kawa picture gen21kawa  ·  5Comments

manoharthondapu picture manoharthondapu  ·  4Comments

ildoonet picture ildoonet  ·  3Comments