You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
When loading small unit test models (such as models that contain only an identity operator) there may not be any params in the params file. When this happens the "save_dict" is an empty list rather than a dict. In load_checkpoint an error is thrown when we call "*.items()" on a list when its expecting a dict.
We need to add a check before the for loop to avoid this problem
Example code
import mxnet as mx
a = mx.sym.var('data')
s = mx.sym.identity(a)
mod = mx.mod.Module(s)
mod.bind(for_training=False, data_shapes=[('data',(1,))])
mod.init_params()
mod.save_checkpoint('identity',0)
s,a,x = mx.model.load_checkpoint('identity',0)
Error Message
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/mxnet/model.py", line 452, in load_checkpoint
for k, v in save_dict.items():
AttributeError: 'list' object has no attribute 'items'
The text was updated successfully, but these errors were encountered:
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: Bug
When loading small unit test models (such as models that contain only an identity operator) there may not be any params in the params file. When this happens the "save_dict" is an empty list rather than a dict. In load_checkpoint an error is thrown when we call "*.items()" on a list when its expecting a dict.
https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/model.py#L451-L454
We need to add a check before the for loop to avoid this problem
Example code
Error Message
The text was updated successfully, but these errors were encountered: