Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug #6

Open
0xinit opened this issue Aug 8, 2021 · 2 comments
Open

Bug #6

0xinit opened this issue Aug 8, 2021 · 2 comments

Comments

@0xinit
Copy link

0xinit commented Aug 8, 2021

CMakeFiles/normalSpeed.dir/build.make:110: recipe for target 'CMakeFiles/normalSpeed.dir/np2mat/ndarray_converter.cpp.o' failed
make[2]: *** [CMakeFiles/normalSpeed.dir/np2mat/ndarray_converter.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/normalSpeed.dir/all' failed
make[1]: *** [CMakeFiles/normalSpeed.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

This happens when I try to install it. Pybind 11 and opencv3 were installed using pip3. Any ideas what's wrong here?

@0xinit
Copy link
Author

0xinit commented Aug 8, 2021

More info about the bug, can someone help me understand what's the problem here?

running install
running bdist_egg
running egg_info
writing normalSpeed.egg-info/PKG-INFO
writing dependency_links to normalSpeed.egg-info/dependency_links.txt
writing top-level names to normalSpeed.egg-info/top_level.txt
reading manifest file 'normalSpeed.egg-info/SOURCES.txt'
writing manifest file 'normalSpeed.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_ext
-- Found pybind11: /usr/local/include (found version "2.7.1" )
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/Desktop/normalSpeed/normalSpeed/build/temp.linux-x86_64-3.6
[ 25%] Building CXX object CMakeFiles/normalSpeed.dir/np2mat/ndarray_converter.cpp.o
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:92:5: error: ‘UMatData’ does not name a type
UMatData* allocate(PyObject* o, int dims, const int* sizes, int type, size_t* step) const
^~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:105:5: error: ‘UMatData’ does not name a type
UMatData* allocate(int dims0, const int* sizes, int type, void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const
^~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:134:19: error: ‘UMatData’ has not been declared
bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const
^~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:134:49: error: ‘UMatUsageFlags’ has not been declared
bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const
^~~~~~~~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:139:21: error: ‘UMatData’ has not been declared
void deallocate(UMatData* u) const
^~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp: In constructor ‘NumpyAllocator::NumpyAllocator()’:
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:89:44: error: ‘getStdAllocator’ is not a member of ‘cv::Mat’
NumpyAllocator() { stdAllocator = Mat::getStdAllocator(); }
^~~~~~~~~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp: In member function ‘bool NumpyAllocator::allocate(int*, int, int) const’:
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:136:65: error: no matching function for call to ‘cv::MatAllocator::allocate(int*&, int&, int&) const’
return stdAllocator->allocate(u, accessFlags, usageFlags);
^
In file included from /home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.h:5:0,
from /home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:4:
/usr/local/include/opencv2/core/core.hpp:1497:18: note: candidate: virtual void cv::MatAllocator::allocate(int, const int*, int, int*&, uchar*&, uchar*&, size_t*)
virtual void allocate(int dims, const int* sizes, int type, int*& refcount,
^~~~~~~~
/usr/local/include/opencv2/core/core.hpp:1497:18: note: candidate expects 7 arguments, 3 provided
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp: In member function ‘void NumpyAllocator::deallocate(int*) const’:
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:144:22: error: request for member ‘urefcount’ in ‘* u’, which is of non-class type ‘int’
CV_Assert(u->urefcount >= 0);
^
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:145:22: error: request for member ‘refcount’ in ‘* u’, which is of non-class type ‘int’
CV_Assert(u->refcount >= 0);
^
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:146:15: error: request for member ‘refcount’ in ‘* u’, which is of non-class type ‘int’
if(u->refcount == 0)
^~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:148:41: error: request for member ‘userdata’ in ‘* u’, which is of non-class type ‘int’
PyObject* o = (PyObject*)u->userdata;
^~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp: At global scope:
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:157:16: error: cannot declare variable ‘g_numpyAllocator’ to be of abstract type ‘NumpyAllocator’
NumpyAllocator g_numpyAllocator;
^~~~~~~~~~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:86:7: note: because the following virtual functions are pure within ‘NumpyAllocator’:
class NumpyAllocator : public MatAllocator
^~~~~~~~~~~~~~
In file included from /home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.h:5:0,
from /home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:4:
/usr/local/include/opencv2/core/core.hpp:1497:18: note: virtual void cv::MatAllocator::allocate(int, const int*, int, int*&, uchar*&, uchar*&, size_t*)
virtual void allocate(int dims, const int* sizes, int type, int*& refcount,
^~~~~~~~
/usr/local/include/opencv2/core/core.hpp:1499:18: note: virtual void cv::MatAllocator::deallocate(int*, uchar*, uchar*)
virtual void deallocate(int* refcount, uchar* datastart, uchar* data) = 0;
^~~~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp: In static member function ‘static bool NDArrayConverter::toMat(PyObject*, cv::Mat&)’:
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:326:7: error: ‘class cv::Mat’ has no member named ‘u’
m.u = g_numpyAllocator.allocate(o, ndims, size, type, step);
^
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:326:63: error: no matching function for call to ‘NumpyAllocator::allocate(PyObject*&, int&, int [33], int&, size_t [33])’
m.u = g_numpyAllocator.allocate(o, ndims, size, type, step);
^
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:134:10: note: candidate: bool NumpyAllocator::allocate(int*, int, int) const
bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const
^~~~~~~~
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:134:10: note: candidate expects 3 arguments, 5 provided
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp: In static member function ‘static PyObject* NDArrayConverter::toNDArray(const cv::Mat&)’:
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:343:12: error: ‘class cv::Mat’ has no member named ‘u’
if(!p->u || p->allocator != &g_numpyAllocator)
^
/home/ubuntu/Desktop/normalSpeed/normalSpeed/np2mat/ndarray_converter.cpp:349:33: error: ‘class cv::Mat’ has no member named ‘u’
PyObject* o = (PyObject*)p->u->userdata;
^
CMakeFiles/normalSpeed.dir/build.make:110: recipe for target 'CMakeFiles/normalSpeed.dir/np2mat/ndarray_converter.cpp.o' failed
make[2]: *** [CMakeFiles/normalSpeed.dir/np2mat/ndarray_converter.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/normalSpeed.dir/all' failed
make[1]: *** [CMakeFiles/normalSpeed.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "setup.py", line 67, in
zip_safe=False,
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/site-packages/setuptools/init.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 167, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/site-packages/setuptools/command/bdist_egg.py", line 153, in call_command
self.run_command(cmdname)
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/site-packages/setuptools/command/install_lib.py", line 11, in run
self.build()
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/command/install_lib.py", line 107, in build
self.run_command('build_ext')
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "setup.py", line 33, in run
self.build_extension(ext)
File "setup.py", line 58, in build_extension
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
File "/home/ubuntu/anaconda3/envs/ffb/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.

This was referenced Aug 9, 2021
@lucasbrodo
Copy link

Hello @Gauravajariwal11 ,
I encounter exactly the same problem. Have you managed to resolve it ?
I would really appreciate it if you could help me on that.
Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants