Module 'mxnet.lr_scheduler' has no attribute 'CosineScheduler'

I am using mxnet in a Jupyter Notebook within a conda_mxnet_p36 SageMaker environment.

mx.__version__: '1.3.0'

When importing the lr_scheduler, only a very limited set of options is available, against what the docs suggest.

Is this just a versioning issue?
Shall I upgrade to 1.3.1?
Thanks a lot in advance

Hi, I don’t know what’s going wrong in your installation, on my laptop (install via pip) it exists:

hope this helps.

1 Like

Thanks for checking this out.
Really weird indeed as I am using the standard mxnet installation provided within SageMaker.

1 Like

I wouldn’t recommend upgrading to 1.3.1 if you intend to use SageMaker to train with Estimators. The notebook instance is currently running 1.3.0 and the training and inference instances only support 1.3.0, 1.2.1, 1.1.0, 1.0.0, 0.12.1. The training instances run a version of MXNet dictated by the framework_version kwarg in Estimator.

If you were just using SageMaker’s notebook as a hosted notebook instance you can update the version of MXNet to 1.3.1 as follows but you will not be able to train/infer with this version.

pip list |grep mxnet


keras-mxnet                        2.2.2      
mxnet-cu90mkl                      1.3.0.post0 <- We'll uninstall and reinstall
mxnet-model-server                 0.4        

You can install the latest MXNet on the notebook instance by running

pip uninstall mxnet-cu90mkl -y
pip install mxnet-cu90mkl

You’ll see: Successfully installed mxnet-cu90mkl-1.3.1


Thanks a lot for the response!