apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.79k stars 6.79k forks source link

Loading parameters and architecture from file (gluon I3D model) #20057

Closed Gregorino closed 3 years ago

Gregorino commented 3 years ago

Description

I have trained and exported gluon's (I3D model) to:

Loading the model by calling:

mx.gluon.nn.SymbolBlock.imports("model-symbol.json", ['data'], "model-0000.params", ctx=context)

fails. And the output is incomplete model:

SymbolBlock(
<Symbol dense0_fwd> : 1 -> 1

Error Message

This warning appears when trying to load the model:

UserWarning: Cannot decide type for the following arguments. Consider providing them as input:
data: None
input_sym_arg_type = in_param.infer_type()[0]

Environment

custom build mxnet 1.8, with cuda 11 python 3.8

github-actions[bot] commented 3 years ago

Welcome to Apache MXNet (incubating)! We are on a mission to democratize AI, and we are glad that you are contributing to it by opening this issue. Please make sure to include all the relevant context, and one of the @apache/mxnet-committers will be here shortly. If you are interested in contributing to our project, let us know! Also, be sure to check out our guide on contributing to MXNet and our development guides wiki.

bgawrych commented 3 years ago

Hi @Gregorino, it is only warning that input data type can't be inferred during loading model, but it's assumed to be fp32. Your model probably have loaded correctly. To visualize graph you can follow this tutorial: https://mxnet.apache.org/versions/1.7.0/api/faq/visualize_graph

sym = mx.symbol.load("model-symbol.json")
mx.viz.plot_network(net)