You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@mxnet.apache.org by Dmitry via MXNet Forum <mx...@discoursemail.com.INVALID> on 2021/12/16 13:13:30 UTC

[MXNet Forum] Bad alloc during load_checkpoint


Hi!
I want to launch one of the mxnet models from here:
https://github.com/deepinsight/insightface/tree/master/model_zoo
Pretrained models are given in archive. I extracted these files to folder:
model-symbol.json
model-0000.params

I installed mxnet with pip3 install mxnet-cu110

Now I try to do this in code:
import mxnet as mx

prefix='./insight/model'
epoch = '0000'
ctx = mx.gpu(0)
sym, arg_params, aux_params = mx.model.load_checkpoint(prefix, epoch)

But it says:
MXNetError                                Traceback (most recent call last)
<ipython-input-2-f15867643d00> in <module>
      5 
      6 ctx = mx.gpu(0)
----> 7 sym, arg_params, aux_params = mx.model.load_checkpoint(prefix, epoch)
      8 all_layers = sym.get_internals()
      9 sym = all_layers['fc1_output']

~/.local/lib/python3.6/site-packages/mxnet/model.py in load_checkpoint(prefix, epoch)
    474     - Parameters will be loaded from ``prefix-epoch.params``.
    475     """
--> 476     symbol = sym.load('%s-symbol.json' % prefix)
    477     arg_params, aux_params = load_params(prefix, epoch)
    478     return (symbol, arg_params, aux_params)

~/.local/lib/python3.6/site-packages/mxnet/symbol/symbol.py in load(fname)
   3052         raise TypeError('fname need to be string')
   3053     handle = SymbolHandle()
-> 3054     check_call(_LIB.MXSymbolCreateFromFile(c_str(fname), ctypes.byref(handle)))
   3055     return Symbol(handle)
   3056 

~/.local/lib/python3.6/site-packages/mxnet/base.py in check_call(ret)
    244     """
    245     if ret != 0:
--> 246         raise get_last_ffi_error()
    247 
    248 

MXNetError: std: :bad_alloc

I'm trying to repeat loading process form here:
https://github.com/deepinsight/insightface/blob/master/recognition/arcface_mxnet/verification.py
What can I do with that? Thanks in advance.





---
[Visit Topic](https://discuss.mxnet.apache.org/t/bad-alloc-during-load-checkpoint/7117/1) or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.mxnet.apache.org/email/unsubscribe/89f173dbc56a2cb252cd465fb24c2faf43023ef223567467d59108ef298a50a5).