Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Gluon Inference failed #15281

Closed
lanking520 opened this issue Jun 19, 2019 · 8 comments
Closed

Gluon Inference failed #15281

lanking520 opened this issue Jun 19, 2019 · 8 comments

Comments

@lanking520
Copy link
Member

lanking520 commented Jun 19, 2019

Currently, the nightly build has the problem for inference. I tested on Ubuntu 16.04 with the following command:

pip install mxnet-mkl --pre

and the code:

from mxnet import gluon
from mxnet import ndarray as nd
import mxnet as mx

prefix = '/Model/resnet_ssd/resnet_ssd_model'

imported_net = gluon.nn.SymbolBlock.imports(prefix + '-symbol.json', ['data'],
                                            prefix + '-0000.params')

imported_net.hybridize(static_alloc = True, static_shape = True)

data = nd.ones((1, 3,  100, 100))
# softmax_label = nd.ones((1))

for i in range(0, 10):
  result = imported_net(data)

print(result[0])

To download the model:

    curl https://s3.amazonaws.com/model-server/models/resnet50_ssd/resnet50_ssd_model-symbol.json -O
    curl https://s3.amazonaws.com/model-server/models/resnet50_ssd/resnet50_ssd_model-0000.params -O
    curl https://s3.amazonaws.com/model-server/models/resnet50_ssd/synset.txt -O

You will see the following problems:

/usr/local/lib/python2.7/dist-packages/mxnet/gluon/block.py:1149: UserWarning: Cannot decide type for the following arguments. Consider providing them as input:
	data: None
  input_sym_arg_type = in_param.infer_type()[0]
corrupted double-linked list
Aborted (core dumped)

@frankfliu identified that the crash happened in between June 12 - June 13. All previous version works fine.

@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Gluon, Bug

@lanking520 lanking520 added Bug and removed Build labels Jun 19, 2019
@samskalicky
Copy link
Contributor

Looks like it works fine without static_shape=True

Possibly related to: #15187
@pengzhao-intel @xinyu-intel

Also works fine with mxnet (non-MKL version)

@pengzhao-intel
Copy link
Contributor

@ZhennanQin will look into the issue. Thank to let us know :)

@pinaraws
Copy link

@mxnet-label-bot add[MKL]

@lanking520
Copy link
Member Author

#15337 This is the related issue

@roywei
Copy link
Member

roywei commented Jul 19, 2019

I have verified #15298 fix this issue, it's already in 1.5.0. Please reopen if there are further issues. Also #15337 might not be related in this case.

@roywei
Copy link
Member

roywei commented Jul 19, 2019

FYI outputs of mxnet and mxnet-mkl 1.5.0 nightly pip.

[12:30:54] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v0.11.0. Attempting to upgrade...
[12:30:54] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
/Users/lawei/anaconda3/lib/python3.6/site-packages/mxnet/gluon/block.py:1159: UserWarning: Cannot decide type for the following arguments. Consider providing them as input:
	data: None
  input_sym_arg_type = in_param.infer_type()[0]

[[10.          0.0754904   0.0194788   0.27124703  1.          0.75776136]
 [-1.          0.06202308  0.1804752   0.17108718  0.8625897   0.8579562 ]
 [-1.          0.06036513  0.13545284  0.1217882   0.88899267  0.89453715]
 ...
 [-1.         -1.         -1.         -1.         -1.         -1.        ]
 [-1.         -1.         -1.         -1.         -1.         -1.        ]
 [-1.         -1.         -1.         -1.         -1.         -1.        ]]
<NDArray 330x6 @cpu(0)>

@MichaelCurrie
Copy link

MichaelCurrie commented Sep 10, 2022

I still get this warning with mxnet.__version__ 1.7.0 and gluoncv.__version__ 0.11.0.

So I suppressed the warning with:

# Suppress https://github.com/apache/incubator-mxnet/issues/15281
with warnings.catch_warnings():
    warnings.simplefilter("ignore")
    self.resnet = gcv.model_zoo.get_model(...)

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

No branches or pull requests

8 participants