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

Error of mx.callback.do_checkpoint on Python3 #2037

Closed
Keiku opened this issue May 5, 2016 · 3 comments
Closed

Error of mx.callback.do_checkpoint on Python3 #2037

Keiku opened this issue May 5, 2016 · 3 comments

Comments

@Keiku
Copy link
Contributor

Keiku commented May 5, 2016

When I executed mx.callback.do_checkpoint code on Python3, I got the below AttributeError because Python3 didn't support 'has_key'. Is there a way to use mx.callback.do_checkpoint on Python3?

Traceback (most recent call last):
  File "train_inception.py", line 86, in <module>
    epoch_end_callback = mx.callback.do_checkpoint(MODEL_PREFIX),
  File "/home/kuroyanagi/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages/mxnet-0.5.0-py3.4.egg/mxnet/model.py", line 745, in fit
    self._init_params(dict(data.provide_data+data.provide_label))
  File "/home/kuroyanagi/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages/mxnet-0.5.0-py3.4.egg/mxnet/model.py", line 501, in _init_params
    self.initializer(k, v)
  File "/home/kuroyanagi/.pyenv/versions/anaconda3-2.3.0/lib/python3.4/site-packages/mxnet-0.5.0-py3.4.egg/mxnet/initializer.py", line 111, in __call__
    if self.param.has_key(name):
AttributeError: 'dict' object has no attribute 'has_key'
@piiswrong
Copy link
Contributor

piiswrong commented May 5, 2016

if self.param.has_key(name) -> if name in self.param
You are welcome to propose a PR to fix these

@Keiku
Copy link
Contributor Author

Keiku commented May 5, 2016

Thank you for your suggestion. I have created a PR for this issue just now.

@Keiku
Copy link
Contributor Author

Keiku commented May 6, 2016

This issue was resolved by #2038.

@Keiku Keiku closed this as completed May 6, 2016
@chihming chihming mentioned this issue Oct 17, 2017
6 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants