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

cv2.error: OpenCV(3.4.8) /io/opencv/modules/imgproc/src/resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'resize' #14

Open
jingruhou opened this issue Dec 26, 2019 · 4 comments

Comments

@jingruhou
Copy link

(base) hjr@houjingru:~/develop/ArcFace-Multiplex-Recognition-master$ python usb_camera.py -c 0
[0]
aiohttp not installed -- cannot make HTTP requests!
[02:15:41] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.4.1. Attempting to upgrade...
[02:15:41] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
Exception in thread Thread-2:
Traceback (most recent call last):
File "/home/hjr/anaconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/home/hjr/anaconda3/lib/python3.7/threading.py", line 870, in run
self._target(self._args, *self._kwargs)
File "usb_camera.py", line 139, in
Process(target=lambda: asyncio.run(detection_loop(preload))).start()
File "/home/hjr/anaconda3/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/home/hjr/anaconda3/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
File "usb_camera.py", line 67, in detection_loop
detector = face_detector.DetectorModel(preload)
File "/home/hjr/develop/ArcFace-Multiplex-Recognition-master/face_detector.py", line 14, in init
self.detector = RetinaFace(args.retina_model, 0, args.gpu, 'net3')
File "/home/hjr/develop/ArcFace-Multiplex-Recognition-master/retinaface.py", line 84, in init
sym, arg_params, aux_params = mx.model.load_checkpoint(prefix, epoch)
File "/home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/model.py", line 451, in load_checkpoint
save_dict = nd.load('%s-%04d.params' % (prefix, epoch))
File "/home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/ndarray/utils.py", line 175, in load
ctypes.byref(names)))
File "/home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/base.py", line 253, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [02:15:41] src/ndarray/ndarray.cc:1839: Check failed: header == kMXAPINDArrayListMagic: Invalid NDArray file format
Stack trace:
[bt] (0) /home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x2795cb) [0x7fb1ed6345cb]
[bt] (1) /home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(mxnet::NDArray::Load(dmlc::Stream
, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >
, std::vector<std::string, std::allocatorstd::string >*)+0x161) [0x7fb1ef90a6e1]
[bt] (2) /home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(MXNDArrayLoad+0x263) [0x7fb1ef69f463]
[bt] (3) /home/hjr/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call_unix64+0x4c) [0x7fb200458ec0]
[bt] (4) /home/hjr/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call+0x22d) [0x7fb20045887d]
[bt] (5) /home/hjr/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(_ctypes_callproc+0x2ce) [0x7fb209cb7ede]
[bt] (6) /home/hjr/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(+0x12914) [0x7fb209cb8914]
[bt] (7) python(_PyObject_FastCallKeywords+0x49b) [0x5558043748fb]
[bt] (8) python(_PyEval_EvalFrameDefault+0x52f8) [0x5558043d86e8]

[02:15:41] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.4.1. Attempting to upgrade...
[02:15:41] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/hjr/anaconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/home/hjr/anaconda3/lib/python3.7/threading.py", line 870, in run
self._target(self._args, *self._kwargs)
File "usb_camera.py", line 138, in
Process(target=lambda: asyncio.run(embedding_loop(preload))).start()
File "/home/hjr/anaconda3/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/home/hjr/anaconda3/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
File "usb_camera.py", line 57, in embedding_loop
embedding = face_embedding.EmbeddingModel(preload)
File "/home/hjr/develop/ArcFace-Multiplex-Recognition-master/face_embedding.py", line 39, in init
self.model = get_model(ctx, image_size, args.arcface_model, 'fc1')
File "/home/hjr/develop/ArcFace-Multiplex-Recognition-master/face_embedding.py", line 23, in get_model
sym, arg_params, aux_params = mx.model.load_checkpoint(prefix, epoch)
File "/home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/model.py", line 451, in load_checkpoint
save_dict = nd.load('%s-%04d.params' % (prefix, epoch))
File "/home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/ndarray/utils.py", line 175, in load
ctypes.byref(names)))
File "/home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/base.py", line 253, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [02:15:41] src/ndarray/ndarray.cc:1839: Check failed: header == kMXAPINDArrayListMagic: Invalid NDArray file format
Stack trace:
[bt] (0) /home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x2795cb) [0x7fb1ed6345cb]
[bt] (1) /home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(mxnet::NDArray::Load(dmlc::Stream
, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >
, std::vector<std::string, std::allocatorstd::string >*)+0x161) [0x7fb1ef90a6e1]
[bt] (2) /home/hjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(MXNDArrayLoad+0x263) [0x7fb1ef69f463]
[bt] (3) /home/hjr/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call_unix64+0x4c) [0x7fb200458ec0]
[bt] (4) /home/hjr/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call+0x22d) [0x7fb20045887d]
[bt] (5) /home/hjr/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(_ctypes_callproc+0x2ce) [0x7fb209cb7ede]
[bt] (6) /home/hjr/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(+0x12914) [0x7fb209cb8914]
[bt] (7) python(_PyObject_FastCallKeywords+0x49b) [0x5558043748fb]
[bt] (8) python(_PyEval_EvalFrameDefault+0x52f8) [0x5558043d86e8]

select timeout
VIDIOC_DQBUF: Resource temporarily unavailable
VIDIOC_QBUF: Invalid argument
Traceback (most recent call last):
File "usb_camera.py", line 141, in
asyncio.run(camera_loop(preload))
File "/home/hjr/anaconda3/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/home/hjr/anaconda3/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
File "usb_camera.py", line 107, in camera_loop
for code in code_list]
File "usb_camera.py", line 107, in
for code in code_list]
cv2.error: OpenCV(3.4.8) /io/opencv/modules/imgproc/src/resize.cpp:3720: error: (-215:Assertion failed) !ssize.empty() in function 'resize'

@1996scarlet
Copy link
Owner

This may be because the face border is too small.
Remember to determine the size of the face before entering the network
记得在输入网络之前判断人脸的大小

@jingruhou
Copy link
Author

python usb_camera.py -c 0
[0]
Exception in thread Thread-3:
Traceback (most recent call last):
File "/home1/houjr/anaconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/home1/houjr/anaconda3/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "usb_camera.py", line 140, in
Process(target=lambda: asyncio.run(upload_loop())).start()
File "/home1/houjr/anaconda3/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/home1/houjr/anaconda3/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
File "usb_camera.py", line 51, in upload_loop
await sio.connect(url)
File "/home1/houjr/anaconda3/lib/python3.7/site-packages/socketio/asyncio_client.py", line 110, in connect
six.raise_from(exceptions.ConnectionError(exc.args[0]), None)
File "", line 3, in raise_from
socketio.exceptions.ConnectionError: Connection refused by the server

[17:59:05] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.4.1. Attempting to upgrade...
[17:59:05] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
Exception in thread Thread-2:
Traceback (most recent call last):
File "/home1/houjr/anaconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/home1/houjr/anaconda3/lib/python3.7/threading.py", line 870, in run
self._target(self._args, *self._kwargs)
File "usb_camera.py", line 139, in
Process(target=lambda: asyncio.run(detection_loop(preload))).start()
File "/home1/houjr/anaconda3/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/home1/houjr/anaconda3/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
File "usb_camera.py", line 67, in detection_loop
detector = face_detector.DetectorModel(preload)
File "/home1/houjr/project/ArcFace-Multiplex-Recognition-master/face_detector.py", line 14, in init
self.detector = RetinaFace(args.retina_model, 0, args.gpu, 'net3')
File "/home1/houjr/project/ArcFace-Multiplex-Recognition-master/retinaface.py", line 84, in init
sym, arg_params, aux_params = mx.model.load_checkpoint(prefix, epoch)
File "/home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/model.py", line 451, in load_checkpoint
save_dict = nd.load('%s-%04d.params' % (prefix, epoch))
File "/home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/ndarray/utils.py", line 175, in load
ctypes.byref(names)))
File "/home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/base.py", line 253, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [17:59:05] src/ndarray/ndarray.cc:1839: Check failed: header == kMXAPINDArrayListMagic: Invalid NDArray file format
Stack trace:
[bt] (0) /home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x4958fb) [0x7fc5f4a698fb]
[bt] (1) /home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(mxnet::NDArray::Load(dmlc::Stream
, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >
, std::vector<std::string, std::allocatorstd::string >*)+0x161) [0x7fc5f6d8f381]
[bt] (2) /home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(MXNDArrayLoad+0x263) [0x7fc5f6ae6a53]
[bt] (3) /home1/houjr/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call_unix64+0x4c) [0x7fc625aa4ec0]
[bt] (4) /home1/houjr/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call+0x22d) [0x7fc625aa487d]
[bt] (5) /home1/houjr/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(_ctypes_callproc+0x2ce) [0x7fc625cb9ede]
[bt] (6) /home1/houjr/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(+0x12914) [0x7fc625cba914]
[bt] (7) python(_PyObject_FastCallKeywords+0x49b) [0x556dac4708fb]
[bt] (8) python(_PyEval_EvalFrameDefault+0x52f8) [0x556dac4d46e8]

[17:59:05] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.4.1. Attempting to upgrade...
[17:59:05] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home1/houjr/anaconda3/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/home1/houjr/anaconda3/lib/python3.7/threading.py", line 870, in run
self._target(self._args, *self._kwargs)
File "usb_camera.py", line 138, in
Process(target=lambda: asyncio.run(embedding_loop(preload))).start()
File "/home1/houjr/anaconda3/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/home1/houjr/anaconda3/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
return future.result()
File "usb_camera.py", line 57, in embedding_loop
embedding = face_embedding.EmbeddingModel(preload)
File "/home1/houjr/project/ArcFace-Multiplex-Recognition-master/face_embedding.py", line 39, in init
self.model = get_model(ctx, image_size, args.arcface_model, 'fc1')
File "/home1/houjr/project/ArcFace-Multiplex-Recognition-master/face_embedding.py", line 23, in get_model
sym, arg_params, aux_params = mx.model.load_checkpoint(prefix, epoch)
File "/home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/model.py", line 451, in load_checkpoint
save_dict = nd.load('%s-%04d.params' % (prefix, epoch))
File "/home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/ndarray/utils.py", line 175, in load
ctypes.byref(names)))
File "/home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/base.py", line 253, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [17:59:05] src/ndarray/ndarray.cc:1839: Check failed: header == kMXAPINDArrayListMagic: Invalid NDArray file format
Stack trace:
[bt] (0) /home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(+0x4958fb) [0x7fc5f4a698fb]
[bt] (1) /home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(mxnet::NDArray::Load(dmlc::Stream
, std::vector<mxnet::NDArray, std::allocatormxnet::NDArray >
, std::vector<std::string, std::allocatorstd::string >*)+0x161) [0x7fc5f6d8f381]
[bt] (2) /home1/houjr/anaconda3/lib/python3.7/site-packages/mxnet/libmxnet.so(MXNDArrayLoad+0x263) [0x7fc5f6ae6a53]
[bt] (3) /home1/houjr/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call_unix64+0x4c) [0x7fc625aa4ec0]
[bt] (4) /home1/houjr/anaconda3/lib/python3.7/lib-dynload/../../libffi.so.6(ffi_call+0x22d) [0x7fc625aa487d]
[bt] (5) /home1/houjr/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(_ctypes_callproc+0x2ce) [0x7fc625cb9ede]
[bt] (6) /home1/houjr/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-x86_64-linux-gnu.so(+0x12914) [0x7fc625cba914]
[bt] (7) python(_PyObject_FastCallKeywords+0x49b) [0x556dac4708fb]
[bt] (8) python(_PyEval_EvalFrameDefault+0x52f8) [0x556dac4d46e8]

@jingruhou
Copy link
Author

还是这个NDArray的问题

mxnet.base.MXNetError: [18:16:46] src/ndarray/ndarray.cc:1839: Check failed: header == kMXAPINDArrayListMagic: Invalid NDArray file format

@1996scarlet
Copy link
Owner

我的MXNET版本是1.14.X和1.15.X,cuda 9 10 10.1都测试过
要不你试试通过这个链接重新下载对应的模型
如果还有问题可以等我更新更稳定的版本(月底之前)

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