Closed wanghai111 closed 5 years ago
You need to compile the library.
cd pyflow/ python setup.py build_ext -i
Compiling pyflow.pyx because it changed. [1/1] Cythonizing pyflow.pyx /home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/hai/tianchi/pyflow-master/pyflow.pyx tree = Parsing.p_module(s, pxd, full_module_name) running build_ext building 'pyflow' extension creating build creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/src gcc -pthread -B /home/hai/anaconda3/envs/tianchi/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include -I/home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include -I/home/hai/anaconda3/envs/tianchi/include/python3.7m -c pyflow.cpp -o build/temp.linux-x86_64-3.7/pyflow.o cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ In file included from /home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1824:0, from /home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12, from /home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4, from pyflow.cpp:632: /home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
^
gcc -pthread -B /home/hai/anaconda3/envs/tianchi/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include -I/home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include -I/home/hai/anaconda3/envs/tianchi/include/python3.7m -c src/Coarse2FineFlowWrapper.cpp -o build/temp.linux-x86_64-3.7/src/Coarse2FineFlowWrapper.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/Image.h:9:0,
from src/Coarse2FineFlowWrapper.cpp:8:
src/ImageProcessing.h: In static member function ‘static void ImageProcessing::ResizeImage(const T1, T2, int, int, int, int, int)’:
src/ImageProcessing.h:230:60: warning: ‘memset’ used with constant zero length parameter; this could be due to transposed parameters [-Wmemset-transposed-args]
memset(pDstImage,sizeof(T2)DstWidthDstHeightnChannels,0);
^
gcc -pthread -B /home/hai/anaconda3/envs/tianchi/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include -I/home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include -I/home/hai/anaconda3/envs/tianchi/include/python3.7m -c src/Stochastic.cpp -o build/temp.linux-x86_64-3.7/src/Stochastic.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
gcc -pthread -B /home/hai/anaconda3/envs/tianchi/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include -I/home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/numpy/core/include -I/home/hai/anaconda3/envs/tianchi/include/python3.7m -c src/OpticalFlow.cpp -o build/temp.linux-x86_64-3.7/src/OpticalFlow.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from src/Image.h:9:0,
from src/OpticalFlow.h:6,
from src/OpticalFlow.cpp:4:
src/ImageProcessing.h: In static member function ‘static void ImageProcessing::ResizeImage(const T1, T2, int, int, int, int, int)’:
src/ImageProcessing.h:230:60: warning: ‘memset’ used with constant zero length parameter; this could be due to transposed parameters [-Wmemset-transposed-args]
memset(pDstImage,sizeof(T2)DstWidthDstHeightnChannels,0);
^
src/OpticalFlow.cpp: In static member function ‘static void OpticalFlow::SmoothFlowSOR(const DImage&, const DImage&, DImage&, DImage&, DImage&, double, int, int, int)’:
src/OpticalFlow.cpp:267:11: warning: unused variable ‘power_alpha’ [-Wunused-variable]
double power_alpha = 0.5;
^
src/OpticalFlow.cpp:287:11: warning: unused variable ‘_a’ [-Wunused-variable]
double _a = 10000, _b = 0.1;
^
src/OpticalFlow.cpp:287:24: warning: unused variable ‘_b’ [-Wunused-variable]
double _a = 10000, _b = 0.1;
^
src/OpticalFlow.cpp: In static member function ‘static void OpticalFlow::SmoothFlowPDE(const DImage&, const DImage&, DImage&, DImage&, DImage&, double, int, int, int)’:
src/OpticalFlow.cpp:545:11: warning: unused variable ‘power_alpha’ [-Wunused-variable]
double power_alpha = 0.5;
^
src/OpticalFlow.cpp:565:11: warning: unused variable ‘_a’ [-Wunused-variable]
double _a = 10000, _b = 0.1;
^
src/OpticalFlow.cpp:565:24: warning: unused variable ‘_b’ [-Wunused-variable]
double _a = 10000, _b = 0.1;
^
In file included from src/Image.h:9:0,
from src/OpticalFlow.h:6,
from src/OpticalFlow.cpp:4:
src/ImageProcessing.h: In instantiation of ‘static void ImageProcessing::vfiltering(const T1, T2, int, int, int, const double, int) [with T1 = double; T2 = double]’:
src/Image.h:1331:96: required from ‘void Image
Python setup.py build_ext -i is running successfully?
python demo.py Traceback (most recent call last): File "demo.py", line 11, in
import pyflow
ImportError: /home/hai/anaconda3/envs/tianchi/lib/python3.7/site-packages/pyflow.cpython-37m-x86_64-linux-gnu.so: undefined symbol: __warn_memset_zero_len