1996scarlet/ArcFace-Multiplex-Recognition

Invalid NDArray file format

MyraBaba opened this issue · 9 comments

Hi,

In insightface facemodel.py below code gives error for Arc...model


    if len(args.model)>0:
      self.model = get_model(ctx, image_size, args.model, 'fc1')

mxnet.base.MXNetError: [22:42:18] src/ndarray/ndarray.cc:1834: Check failed: header == kMXAPINDArrayListMagic: Invalid NDArray file format

@1996scarlet and @MyraBaba did you solve this error? Because I am also getting this error

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/media/mustafa/ubuntu_backup/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/media/mustafa/ubuntu_backup/anaconda3/lib/python3.7/threading.py", line 865, in run
    self._target(*self._args, **self._kwargs)
  File "usb_camera.py", line 139, in <lambda>
    Process(target=lambda: asyncio.run(detection_loop(preload))).start()
  File "/media/mustafa/ubuntu_backup/anaconda3/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/media/mustafa/ubuntu_backup/anaconda3/lib/python3.7/asyncio/base_events.py", line 573, in run_until_complete
    return future.result()
  File "usb_camera.py", line 67, in detection_loop
    detector = face_detector.DetectorModel(preload)
  File "/media/mustafa/ubuntu_backup/Projects/mustafa_face_dl/ArcFace-Multiplex-Recognition/face_detector.py", line 14, in __init__
    self.detector = RetinaFace(args.retina_model, 0, args.gpu, 'net3')
  File "/media/mustafa/ubuntu_backup/Projects/mustafa_face_dl/ArcFace-Multiplex-Recognition/retinaface.py", line 84, in __init__
    sym, arg_params, aux_params = mx.model.load_checkpoint(prefix, epoch)
  File "/home/mustafa/.local/lib/python3.7/site-packages/mxnet/model.py", line 438, in load_checkpoint
    save_dict = nd.load('%s-%04d.params' % (prefix, epoch))
  File "/home/mustafa/.local/lib/python3.7/site-packages/mxnet/ndarray/utils.py", line 175, in load
    ctypes.byref(names)))
  File "/home/mustafa/.local/lib/python3.7/site-packages/mxnet/base.py", line 252, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [20:50:08] src/ndarray/ndarray.cc:1803: Check failed: header == kMXAPINDArrayListMagic Invalid NDArray file format

@1996scarlet and @MyraBaba
I have the same issue..Do you use mxcu101? Any idea to fix this?

So could you please tell me which version of cuda and mxnet are you using?

Another method worth trying is to use this file to test a single image of the ArcFace model.
https://github.com/deepinsight/insightface/blob/master/deploy/test.py

I have cuda 9.0 and cuda 10.1 but default is 10.1 mxnet-cu101 even tried with mxnet-cu90. I tried the insightface it's working

I have tried cuda8.0 and mxnet-cu80, the same error.

Download the model again from InsightFace repo. The link is given in the RetinaFace readme.md
I used your model in the RetinaFace code this problem came. But when i redownloaded the model from their repo. the problem vanished. Not sure what is the problem but my naive guess would be corruption of json file.

请问你们的MXNet的是哪个版本?

weight files are stored in git lfs, so you must download them to run:
sudo apt-get install git-lfs
git lfs install
git lfs pull

Hi guys,

I got this error in Linux Mint
mxnet.base.MXNetError: [13:46:01] src/ndarray/ndarray.cc:1112: Check failed: header == kMXAPINDArrayListMagic Invalid NDArray file format
I solved it by doing what @hoanganh928 did above:

sudo apt-get install git-lfs
git lfs install
git lfs pull