首页 > 其他 > 详细

nni 环境搭建

时间:2020-11-11 22:01:50      阅读:85      评论:0      收藏:0      [点我收藏+]

1. 创建虚拟环境

conda create -n nni python=3.7
conda activate nni

2. 安装nni

pip install nni==1.9 tensorflow==1.15.4  # 需要手动安装tf 1.x
git clone -b v1.9 https://gitee.com/oaksharks/nni.git  # 需要源码运行样例

3. 遇到的问题

启动任务时候遇到报错:

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module ‘/home/oaksharks/miniconda3/envs/nni/nni/node_modules/sqlite3/lib/binding/node-v83-linux-x64/node_sqlite3.node‘
Require stack:
- /home/oaksharks/miniconda3/envs/nni/nni/node_modules/sqlite3/lib/sqlite3-binding.js
- /home/oaksharks/miniconda3/envs/nni/nni/node_modules/sqlite3/lib/sqlite3.js
- /home/oaksharks/miniconda3/envs/nni/nni/core/sqlDatabase.js
- /home/oaksharks/miniconda3/envs/nni/nni/main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/oaksharks/miniconda3/envs/nni/nni/node_modules/sqlite3/lib/sqlite3-binding.js:4:15)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: ‘MODULE_NOT_FOUND‘,
  requireStack: [
    ‘/home/oaksharks/miniconda3/envs/nni/nni/node_modules/sqlite3/lib/sqlite3-binding.js‘,
    ‘/home/oaksharks/miniconda3/envs/nni/nni/node_modules/sqlite3/lib/sqlite3.js‘,
    ‘/home/oaksharks/miniconda3/envs/nni/nni/core/sqlDatabase.js‘,
    ‘/home/oaksharks/miniconda3/envs/nni/nni/main.js‘
  ]
}

解决办法:

$ cd /home/oaksharks/miniconda3/envs/nni/nni/node_modules
yarn install

4. 启动实验

nnictl create --port 8480 --config nni/examples/trials/mnist-tfv1/config.yml
# nnictl experiment show # 查看执行中的任务
# nnictl stop # 关闭运行中的任务

nni 环境搭建

原文:https://www.cnblogs.com/oaks/p/13960607.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!