[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-01-28 UTC."],[],[],null,["# Install Neural Structured Learning\n\nThere are several ways to set up your environment to use Neural Structured\nLearning (NSL) in TensorFlow:\n\n- The easiest way to learn and use NSL requires no installation: run the NSL tutorials directly in your browser using [Google Colaboratory](https://colab.research.google.com/notebooks/welcome.ipynb).\n- To use NSL on a local machine, install the [NSL package](#install_neural_structured_learning_using_pip) with Python's `pip` package manager.\n- If you have a unique machine configuration, [build NSL](#build_the_neural_structured_learning_pip_package) from source.\n\n| **Note:** NSL requires a TensorFlow version of 1.15 or higher. NSL also supports TensorFlow 2.x with the exception of v2.1, which contains a bug that is incompatible with NSL.\n\nInstall Neural Structured Learning using pip\n--------------------------------------------\n\n#### 1. Install the Python development environment.\n\nOn Ubuntu: \n\n sudo apt update\n sudo apt install python3-dev python3-pip # Python 3\n sudo pip3 install --upgrade virtualenv # system-wide install\n\nOn macOS: \n\n /usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n export PATH=\"/usr/local/bin:/usr/local/sbin:$PATH\"\n brew update\n brew install python # Python 3\n sudo pip3 install --upgrade virtualenv # system-wide install\n\n#### 2. Create a virtual environment.\n\n virtualenv --python python3 \"./venv\"\n source \"./venv/bin/activate\"\n pip install --upgrade pip\n\n| **Note:** To exit the virtual environment, run `deactivate`.\n\n#### 3. Install TensorFlow\n\nCPU support: \n\n pip install 'tensorflow\u003e=1.15.0'\n\nGPU support: \n\n pip install 'tensorflow-gpu\u003e=1.15.0'\n\n#### 4. Install the Neural Structured Learning `pip` package.\n\n pip install --upgrade neural_structured_learning\n\n#### 5. (Optional) Test Neural Structured Learning.\n\n python -c \"import neural_structured_learning as nsl\"\n\n| **Success:** Neural Structured Learning is now installed.\n\nBuild the Neural Structured Learning pip package\n------------------------------------------------\n\n#### 1. Install the Python development environment.\n\nOn Ubuntu: \n\n sudo apt update\n sudo apt install python3-dev python3-pip # Python 3\n sudo pip3 install --upgrade virtualenv # system-wide install\n\nOn macOS: \n\n /usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n export PATH=\"/usr/local/bin:/usr/local/sbin:$PATH\"\n brew update\n brew install python # Python 3\n sudo pip3 install --upgrade virtualenv # system-wide install\n\n#### 2. Install Bazel.\n\n[Install Bazel](https://docs.bazel.build/versions/master/install.html), the\nbuild tool used to compile Neural Structured Learning.\n\n#### 3. Clone the Neural Structured Learning repository.\n\n git clone https://github.com/tensorflow/neural-structured-learning.git\n\n#### 4. Create a virtual environment.\n\n virtualenv --python python3 \"./venv\"\n source \"./venv/bin/activate\"\n pip install --upgrade pip\n\n| **Note:** To exit the virtual environment, run `deactivate`.\n\n#### 5. Install Tensorflow\n\nNote that NSL requires a TensorFlow version of 1.15 or higher. NSL also supports\nTensorFlow 2.0.\n\nCPU support: \n\n pip install 'tensorflow\u003e=1.15.0'\n\nGPU support: \n\n pip install 'tensorflow-gpu\u003e=1.15.0'\n\n#### 6. Install Neural Structured Learning dependencies.\n\n cd neural-structured-learning\n pip install --requirement neural_structured_learning/requirements.txt\n\n#### 7. (Optional) Unit Test Neural Structured Learning.\n\n bazel test //neural_structured_learning/...\n\n#### 8. Build the pip package.\n\n python setup.py bdist_wheel --universal --dist-dir=\"./wheel\"\n\n#### 9. Install the pip package.\n\n pip install --upgrade ./wheel/neural_structured_learning*.whl\n\n#### 10. Test Neural Structured Learning.\n\n python -c \"import neural_structured_learning as nsl\"\n\n| **Success:** The Neural Structured Learning package is built."]]