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.75k stars 6.8k forks source link

AttributeError: 'SymbolBlock' object has no attribute '_cached_op_args' #20577

Open chansonzhang opened 2 years ago

chansonzhang commented 2 years ago

Discussed in https://github.com/apache/incubator-mxnet/discussions/20575

Originally posted by **chansonzhang** September 12, 2021 When I run the code in the guide [https://nlp.gluon.ai/v0.9.x/examples/sentence_embedding/bert.html#Deployment](https://nlp.gluon.ai/v0.9.x/examples/sentence_embedding/bert.html#Deployment), it reported `AttributeError: 'SymbolBlock' object has no attribute '_cached_op_args'` in code line `net.export(prefix, epoch=0)` --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () 26 # will remove until mxnet 1.7 release. 27 try: ---> 28 eval_metric = deployment(quantized_net, prefix, dev_dataloader) 29 except NameError: 30 nlp.utils.version.check_version('1.7.0', warning_only=True, library=mx) 1 frames /usr/local/lib/python3.7/dist-packages/mxnet/gluon/block.py in export(self, path, epoch, remove_amp_cast) 1246 aux_names = set(sym.list_auxiliary_states()) 1247 arg_dict = {} -> 1248 for is_arg, param in self._cached_op_args: 1249 if not is_arg: 1250 name = param.name AttributeError: 'SymbolBlock' object has no attribute '_cached_op_args'
github-actions[bot] commented 2 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.