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

Invalid NDArray file format #4

Open
MyraBaba opened this issue Jun 5, 2019 · 9 comments
Open

Invalid NDArray file format #4

MyraBaba opened this issue Jun 5, 2019 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@MyraBaba
Copy link

MyraBaba commented Jun 5, 2019

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

@tomriddle54
Copy link

@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

@rebotnix
Copy link

rebotnix commented Jul 3, 2019

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

@1996scarlet 1996scarlet added the help wanted Extra attention is needed label Jul 5, 2019
@1996scarlet
Copy link
Owner

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

@tomriddle54
Copy link

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

@yanjieee
Copy link

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

@lakshaytalkstomachines
Copy link

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.

@jingruhou
Copy link

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

@hoanganh928
Copy link

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

@Raunak-Singh-Inventor
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants