Tf-pose-estimation: Pafprocess import Error

Created on 1 Jun 2018  路  4Comments  路  Source: ildoonet/tf-pose-estimation

Hi, I am not able to import pafprocess while running the realtime webcam command:
python src/run_webcam.py --model=mobilenet_thin --resolution=432x368 --camera=0

issue

also i have used to do the following command to solve this issue by compiling pafprocess first by command:
swig -python -c++ pafprocess.i && python setup.py build_ext --inplace

but still getting this error while running this command itself as:

**(base) C:\Users\HP>cd Desktop\tf-openpose\src\pafprocess

(base) C:\Users\HP\Desktop\tf-openpose\src\pafprocess>swig -python -c++ pafproce
ss.i && python setup.py build_ext --inplace
running build_ext
building '_pafprocess' extension
swigging pafprocess.i to pafprocess_wrap.cpp
C:\Users\HP\Anaconda3\Library\bin\swig.exe -python -c++ -o pafprocess_wrap.cpp p
afprocess.i
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.1
4.26428\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\HP
\Anaconda3\lib\site-packages\numpy\core\include -I. -IC:\Users\HP\Anaconda3\incl
ude -IC:\Users\HP\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual S
tudio\2017\Community\VC\Tools\MSVC\14.14.26428\ATLMFC\include" "-IC:\Program Fil
es (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\includ
e" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Progr
am Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x
86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windo
ws Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\in
clude\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0
.17134.0\cppwinrt" /EHsc /Tppafprocess.cpp /Fobuild\temp.win-amd64-3.6\Release\p
afprocess.obj
pafprocess.cpp
c:\users\hp\desktop\tf-openpose\src\pafprocess\pafprocess.h(6): warning C4305: '
initializing': truncation from 'double' to 'float'
c:\users\hp\desktop\tf-openpose\src\pafprocess\pafprocess.h(7): warning C4305: '
initializing': truncation from 'double' to 'float'
c:\users\hp\desktop\tf-openpose\src\pafprocess\pafprocess.h(10): warning C4305:
'initializing': truncation from 'double' to 'float'
pafprocess.cpp(64): warning C4244: '=': conversion from 'int' to 'float', possib
le loss of data
pafprocess.cpp(65): warning C4244: '=': conversion from 'int' to 'float', possib
le loss of data
pafprocess.cpp(83): warning C4244: 'initializing': conversion from 'double' to '
float', possible loss of data
pafprocess.cpp(138): error C2146: syntax error: missing ')' before identifier 'o
r'
pafprocess.cpp(138): error C2065: 'or': undeclared identifier
pafprocess.cpp(138): error C2146: syntax error: missing ';' before identifier 's
ubset'
pafprocess.cpp(138): error C2059: syntax error: ')'
pafprocess.cpp(139): error C2059: syntax error: 'if'
pafprocess.cpp(145): error C2065: 'found': undeclared identifier
pafprocess.cpp(146): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(146): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(146): error C2228: left of '.cid2' must have class/struct/union
pafprocess.cpp(147): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(147): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(147): error C2228: left of '.cid2' must have class/struct/union
pafprocess.cpp(148): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(149): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(149): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(149): error C2228: left of '.cid2' must have class/struct/union
pafprocess.cpp(149): error C2228: left of '.score' must have class/struct/union
pafprocess.cpp(151): error C2065: 'found': undeclared identifier
pafprocess.cpp(154): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(154): error C2065: 'subset_idx2': undeclared identifier
pafprocess.cpp(160): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(160): error C2065: 'subset_idx2': undeclared identifier
pafprocess.cpp(162): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(162): error C2065: 'subset_idx2': undeclared identifier
pafprocess.cpp(163): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(163): error C2065: 'subset_idx2': undeclared identifier
pafprocess.cpp(164): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(164): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(164): error C2228: left of '.score' must have class/struct/union
pafprocess.cpp(165): error C2065: 'subset_idx2': undeclared identifier
pafprocess.cpp(167): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(167): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(167): error C2228: left of '.cid2' must have class/struct/union
pafprocess.cpp(168): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(169): error C2065: 'subset_idx1': undeclared identifier
pafprocess.cpp(169): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(169): error C2228: left of '.cid2' must have class/struct/union
pafprocess.cpp(169): error C2228: left of '.score' must have class/struct/union
pafprocess.cpp(171): error C2065: 'found': undeclared identifier
pafprocess.cpp(174): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(174): error C2228: left of '.cid1' must have class/struct/union
pafprocess.cpp(175): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(175): error C2228: left of '.cid2' must have class/struct/union
pafprocess.cpp(177): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(177): error C2228: left of '.cid1' must have class/struct/union
pafprocess.cpp(177): error C2228: left of '.score' must have class/struct/union
pafprocess.cpp(178): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(178): error C2228: left of '.cid2' must have class/struct/union
pafprocess.cpp(178): error C2228: left of '.score' must have class/struct/union
pafprocess.cpp(179): error C2065: 'conn_id': undeclared identifier
pafprocess.cpp(179): error C2228: left of '.score' must have class/struct/union
pafprocess.cpp(186): error C2059: syntax error: 'for'
pafprocess.cpp(186): error C2143: syntax error: missing ')' before ';'
pafprocess.cpp(186): error C2143: syntax error: missing ';' before '>='
pafprocess.cpp(186): error C4430: missing type specifier - int assumed. Note: C+

  • does not support default-int
    pafprocess.cpp(186): error C2143: syntax error: missing ';' before '--'
    pafprocess.cpp(186): error C2086: 'int i': redefinition
    pafprocess.cpp(186): note: see declaration of 'i'
    pafprocess.cpp(186): error C2059: syntax error: ')'
    pafprocess.cpp(186): error C2143: syntax error: missing ';' before '{'
    pafprocess.cpp(186): error C2447: '{': missing function header (old-style formal
    list?)
    pafprocess.cpp(191): error C2059: syntax error: 'return'
    pafprocess.cpp(192): error C2059: syntax error: '}'
    pafprocess.cpp(192): error C2143: syntax error: missing ';' before '}'
    pafprocess.cpp(194): error C2143: syntax error: missing ';' before '{'
    pafprocess.cpp(194): error C2447: '{': missing function header (old-style formal
    list?)
    pafprocess.cpp(199): warning C4244: 'return': conversion from 'float' to 'int',
    possible loss of data
    error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Communit
    y\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe' failed with exit sta
    tus 2

(base) C:\Users\HP\Desktop\tf-openpose\src\pafprocess>**

I dont know what to do...

help wanted

Most helpful comment

@ildoonet Hi! 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!)

All 4 comments

I don't know neither. But, I guess the error comes from the compilation environments. Please check your build information.

@ildoonet Hi! 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!)

Yeah 'or' and 'and' are supported by higher version of c++ compiler. So I guess that yours is quite outdated.

Thanks for sharing the solution.

i fixed it by using the command in this way :
swig -python -c++ pafprocess.i setup.py build_ext --inplace

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jax79sg picture jax79sg  路  4Comments

gavinzhang1995 picture gavinzhang1995  路  6Comments

juciny picture juciny  路  3Comments

khaerulumam42 picture khaerulumam42  路  6Comments

zerolim820 picture zerolim820  路  3Comments