服务器创建tensorflow环境,nni自动调参记录

一、anaconda安装记录

1.1 下载安装脚本:
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh

1.2 运行安装向导:
bash Anaconda3-5.2.0-Linux-x86_64.sh

1.3 确认是否安装成功:
conda --version

这个版本的Anaconda3-5.2.0-Linux-x86_64.sh,在vscode连接网络时出错,换了个版本成功。

conda --version未成功,anaconda: command not found

二、修改bashrc文件

1、使用命令:sudo apt install vim 安装vim文本编辑器
2、使用命令:vim ~/.bashrc 修改环境变量

3、在文本最后添加命令:export PATH=~/anaconda3/bin:$PATH

4、重启环境变量:source ~/.bashrc

anaconda安装成功

 三、tensorflow安装

conda create --name tensorflow python=3.5
source activate tensorflow

四、NNI安装和demo运行

  • 当前支持 Linux 和 MacOS。测试并支持的版本包括:Ubuntu 16.04 及更高版本,MacOS 10.14.1。 在 python >= 3.5 的环境中,只需要运行 pip install 即可完成安装。
    python3 -m pip install --upgrade nni
  • 通过克隆源代码下载示例。
    git clone -b v0.5.1 https://github.com/Microsoft/nni.git
  • 运行 mnist 示例。
    nnictl create --config nni/examples/trials/mnist/config.yml
  • 在命令行中等待输出 INFO: Successfully started experiment!。 此消息表明 Experiment 已成功启动。 通过命令行输出的 Web UI url 来访问 Experiment 的界面。

    INFO: Starting restful server...
    INFO: Successfully started Restful server!
    INFO: Setting local config...
    INFO: Successfully set local config!
    INFO: Starting experiment...
    INFO: Successfully started experiment!
    -----------------------------------------------------------------------
    The experiment id is egchD4qy
    The Web UI urls are: http://223.255.255.1:8080   http://127.0.0.1:8080
    -----------------------------------------------------------------------
    
    You can use these commands to get more information about the experiment
    -----------------------------------------------------------------------
             commands                       description
    
    1. nnictl experiment show        show the information of experiments
    2. nnictl trial ls               list all of trial jobs
    3. nnictl top                    monitor the status of running experiments
    4. nnictl log stderr             show stderr log content
    5. nnictl log stdout             show stdout log content
    6. nnictl stop                   stop an experiment
    7. nnictl trial kill             kill a trial job by id
    8. nnictl --help                 get help information about nnictl
    -----------------------------------------------------------------------
    
  • 在浏览器中打开 Web UI url,可看到下图的 Experiment 详细信息,以及所有的 Trial 任务。 查看这里的更多页面示例。



 
原文地址:https://www.cnblogs.com/smartwhite/p/10385136.html