Case use of automatic machine learning framework nni

nni is an automatic machine learning framework open sourced by Microsoft

Can make machine learning tuning more convenient

Installation is very simple, just use pip

pip install nni

This time I am using the latest version, 2.0

But it cannot be used at this time, because it will appear:

https://github.com/microsoft/nni/issues/3276

The solution is also very simple, directly change ruamel.yaml to ruamel_yaml

Edit and modify the content under the path below

vim /opt/AN/lib/python3.7/site-packages/nni/tools/nnictl/common_utils.py
vim /opt/AN/lib/python3.7/site-packages/nni/experiment/config/base.py
vim /opt/AN/lib/python3.7/site-packages/nni/tools/package_utils/__init__.py

Then it can be used normally

root@lizong:/opt# nnictl --help
usage: nnictl [-h] [--version]
              {ss_gen,create,resume,view,update,stop,trial,experiment,platform,webui,config,log,algo,package,tensorboard,top}
              ...

use nnictl command to control nni experiments

positional arguments:
  {ss_gen,create,resume,view,update,stop,trial,experiment,platform,webui,config,log,algo,package,tensorboard,top}
    ss_gen              automatically generate search space file from trial
                        code
    create              create a new experiment
    resume              resume a new experiment
    view                view a stopped experiment
    update              update the experiment
    stop                stop the experiment
    trial               get trial information
    experiment          get experiment information
    platform            get platform information
    webui               get web ui information
    config              get config information
    log                 get log information
    algo                control nni builtin tuner, assessor and advisor
                        algorithms
    package             this argument is replaced by algo
    tensorboard         manage tensorboard
    top                 monitor the experiment

optional arguments:
  -h, --help            show this help message and exit
  --version, -v

Next, run the official example:

nnictl create --config nni/examples/trials/mnist-pytorch/config.yml

Note: git clone is required before running

git clone -b v2.0 https://github.com.cnpmjs.org/Microsoft/nni.git

After running successfully, you can observe the running result on the webpage:

Specific access address ------ running machine ip: 8080

 

We can see that the above picture has been running for 48m54s, and the best score is 99 points

 Look at the hyperparameter curve:

The operation introduction will appear:

 

Guess you like

Origin blog.csdn.net/zhou_438/article/details/113872545