Run Neural Network Intelligence (NNI) in Multiple Python Version Environments – Python NNI Tutorial

By | May 3, 2020

We often use anaconda to install multiple python versions in our computer. However, multiple python version environments may cause python neural network intelligence (NNI) can not be run. In this tutorial, we will fix this problem.

Preliminary

We have installed 4 python verisons in our computer.

Anaconda is installed based on python 3.7, this python version is default.

We also have created python 3.5, 3.6 and 3.7 environments using anaconda.

However, we only install tensorflow in python 3.6 environemnt.

We run nni by .yml file, nni can not be run, the reason is tensroflow is not installed. NNI is run in default python 3.7 environment.

python nni no module named tensorflow

How to fix this problem?

It is easy to fix, open your .yml file and edit the trail command. Here is an example.

trial:
  command: C:\Users\fly165\.conda\envs\py3.6\python.exe mnist-bilstm.py
  codeDir: .
  gpuNum: 0

You should use the absolute path of python 3.6 exe, because we have installed tensorflow in python 3.6

python start nni trail command

Ten start python nni, you will find you can start it successfully.

Leave a Reply