× We want your feedback about Neuron SDK! Let us know by taking the Neuron survey

Install Neuron Plugin for TensorBoard

The Neuron plugin for TensorBoard is available starting with Neuron v1.13.0.

To install the Neuron plugin, first enable ML framework Conda environment of your choice, by running one of the following:

  • Enable PyTorch-Neuron Conda enviroment:

Note

For a successful installation or update, execute each line of the instructions below separately or copy the contents of the code block into a script file and source its contents.

# Note: There is no DLAMI Conda environment for this framework version
#       Framework will be installed/updated inside a Python environment

# Update OS packages
sudo apt-get update -y

################################################################################################################
# To install or update to Neuron versions 1.19.1 and newer from previous releases:
# - DO NOT skip 'aws-neuron-dkms' install or upgrade step, you MUST install or upgrade to latest Neuron driver
################################################################################################################

# Install OS headers
sudo apt-get install linux-headers-$(uname -r) -y

# Install Neuron Driver
sudo apt-get install aws-neuron-dkms --allow-change-held-packages -y

####################################################################################
# Warning: If Linux kernel is updated as a result of OS package update
#          Neuron driver (aws-neuron-dkms) should be re-installed after reboot
####################################################################################

# Install Neuron Tools
sudo apt-get install aws-neuron-tools -y

export PATH=/opt/aws/neuron/bin:$PATH

######################################################
#   Only for Ubuntu 20 - Install Python3.7
#
# sudo add-apt-repository ppa:deadsnakes/ppa
# sudo apt-get install python3.7
#
######################################################
# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo apt-get install -y python3.7-venv g++
python3.7 -m venv pytorch_venv
source pytorch_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.7 -m ipykernel install --user --name pytorch_venv --display-name "Python (Neuron PyTorch)"
pip install jupyter notebook
pip install environment_kernels


# Set Pip repository  to point to the Neuron repository
pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com

#Install Neuron PyTorch
pip install torch-neuron neuron-cc[tensorflow] "protobuf<4" torchvision
  • Enable TensorFlow-Neuron Conda enviroment:

    Note

    For a successful installation or update, execute each line of the instructions below separately or copy the contents of the code block into a script file and source its contents.

    # Note: There is no DLAMI Conda environment for this framework version
    #       Framework will be installed/updated inside a Python environment
    
    # Update OS packages
    sudo apt-get update -y
    
    ################################################################################################################
    # To install or update to Neuron versions 1.19.1 and newer from previous releases:
    # - DO NOT skip 'aws-neuron-dkms' install or upgrade step, you MUST install or upgrade to latest Neuron driver
    ################################################################################################################
    
    # Install OS headers
    sudo apt-get install linux-headers-$(uname -r) -y
    
    # Install Neuron Driver
    sudo apt-get install aws-neuron-dkms --allow-change-held-packages -y
    
    ####################################################################################
    # Warning: If Linux kernel is updated as a result of OS package update
    #          Neuron driver (aws-neuron-dkms) should be re-installed after reboot
    ####################################################################################
    
    # Install Neuron Tools
    sudo apt-get install aws-neuron-tools -y
    
    # Install Neuron TensorBoard
    pip install tensorboard-plugin-neuron
    
    export PATH=/opt/aws/neuron/bin:$PATH
    
    ######################################################
    #   Only for Ubuntu 20 - Install Python3.7
    #
    # sudo add-apt-repository ppa:deadsnakes/ppa
    # sudo apt-get install python3.7
    #
    ######################################################
    # Install Python venv and activate Python virtual environment to install    
    # Neuron pip packages.
    sudo apt-get install -y python3.7-venv g++
    python3.7 -m venv tensorflow_venv
    source tensorflow_venv/bin/activate
    pip install -U pip
    
    
    # Instal Jupyter notebook kernel 
    pip install ipykernel 
    python3.7 -m ipykernel install --user --name tensorflow_venv --display-name "Python (Neuron TensorFlow)"
    pip install jupyter notebook
    pip install environment_kernels
    
    
    # Set Pip repository  to point to the Neuron repository
    pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com
    
    #Install Neuron TensorFlow
    pip install tensorflow-neuron[cc] "protobuf<4"
    
    # Optional: Install Neuron TensorFlow model server
    sudo apt-get install tensorflow-model-server-neuron --allow-change-held-packages -y
    
  • Enable MXNet-Neuron Conda enviroment:

    Note

    For a successful installation or update, execute each line of the instructions below separately or copy the contents of the code block into a script file and source its contents.

    # Note: There is no DLAMI Conda environment for this framework version
    #       Framework will be installed/updated inside a Python environment
    
    # Update OS packages
    sudo apt-get update -y
    
    ################################################################################################################
    # To install or update to Neuron versions 1.19.1 and newer from previous releases:
    # - DO NOT skip 'aws-neuron-dkms' install or upgrade step, you MUST install or upgrade to latest Neuron driver
    ################################################################################################################
    
    # Install OS headers
    sudo apt-get install linux-headers-$(uname -r) -y
    
    # Install Neuron Driver
    sudo apt-get install aws-neuron-dkms --allow-change-held-packages -y
    
    ####################################################################################
    # Warning: If Linux kernel is updated as a result of OS package update
    #          Neuron driver (aws-neuron-dkms) should be re-installed after reboot
    ####################################################################################
    
    # Install Neuron Tools
    sudo apt-get install aws-neuron-tools -y
    
    export PATH=/opt/aws/neuron/bin:$PATH
    
    # Activate MXNet
    source activate aws_neuron_mxnet_p36
    
    # Set Pip repository  to point to the Neuron repository
    pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com
    
    #Install Neuron MXNet
    wget https://aws-mx-pypi.s3.us-west-2.amazonaws.com/1.8.0/aws_mx-1.8.0.2-py2.py3-none-manylinux2014_x86_64.whl
    pip install aws_mx-1.8.0.2-py2.py3-none-manylinux2014_x86_64.whl
    pip install mx_neuron neuron-cc
    

Then run the following:

If you are using the DLAMI TensorFlow-Neuron Conda environment, please run the following to update TensorBoard before installing the Neuron plugin.

pip install "tensorboard<=2.4.0" --force-reinstall

Modify Pip repository configurations to point to the Neuron repository:

tee $VIRTUAL_ENV/pip.conf > /dev/null <<EOF
[global]
extra-index-url = https://pip.repos.neuron.amazonaws.com
EOF
pip install tensorboard-plugin-neuron

Install Neuron TensorBoard (Deprecated)

Warning

TensorBoard-Neuron is deprecated and no longer compatible with Neuron tools version 1.5 and higher. Neuron tools version 1.5 is first introduced in Neuron v1.13.0 release. Please use the Neuron plugin for TensorBoard instead.

To install Tensorboard, first enable ML framework Conda environment of your choice, by running one of the following:

  • Enable PyTorch-Neuron Conda enviroment:

Note

For a successful installation or update, execute each line of the instructions below separately or copy the contents of the code block into a script file and source its contents.

# Note: There is no DLAMI Conda environment for this framework version
#       Framework will be installed/updated inside a Python environment

# Update OS packages
sudo apt-get update -y

################################################################################################################
# To install or update to Neuron versions 1.19.1 and newer from previous releases:
# - DO NOT skip 'aws-neuron-dkms' install or upgrade step, you MUST install or upgrade to latest Neuron driver
################################################################################################################

# Install OS headers
sudo apt-get install linux-headers-$(uname -r) -y

# Install Neuron Driver
sudo apt-get install aws-neuron-dkms --allow-change-held-packages -y

####################################################################################
# Warning: If Linux kernel is updated as a result of OS package update
#          Neuron driver (aws-neuron-dkms) should be re-installed after reboot
####################################################################################

# Install Neuron Tools
sudo apt-get install aws-neuron-tools -y

export PATH=/opt/aws/neuron/bin:$PATH

######################################################
#   Only for Ubuntu 20 - Install Python3.7
#
# sudo add-apt-repository ppa:deadsnakes/ppa
# sudo apt-get install python3.7
#
######################################################
# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo apt-get install -y python3.7-venv g++
python3.7 -m venv pytorch_venv
source pytorch_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.7 -m ipykernel install --user --name pytorch_venv --display-name "Python (Neuron PyTorch)"
pip install jupyter notebook
pip install environment_kernels


# Set Pip repository  to point to the Neuron repository
pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com

#Install Neuron PyTorch
pip install torch-neuron neuron-cc[tensorflow] "protobuf<4" torchvision
  • Enable TensorFlow-Neuron Conda enviroment:

    Note

    For a successful installation or update, execute each line of the instructions below separately or copy the contents of the code block into a script file and source its contents.

    # Note: There is no DLAMI Conda environment for this framework version
    #       Framework will be installed/updated inside a Python environment
    
    # Update OS packages
    sudo apt-get update -y
    
    ################################################################################################################
    # To install or update to Neuron versions 1.19.1 and newer from previous releases:
    # - DO NOT skip 'aws-neuron-dkms' install or upgrade step, you MUST install or upgrade to latest Neuron driver
    ################################################################################################################
    
    # Install OS headers
    sudo apt-get install linux-headers-$(uname -r) -y
    
    # Install Neuron Driver
    sudo apt-get install aws-neuron-dkms --allow-change-held-packages -y
    
    ####################################################################################
    # Warning: If Linux kernel is updated as a result of OS package update
    #          Neuron driver (aws-neuron-dkms) should be re-installed after reboot
    ####################################################################################
    
    # Install Neuron Tools
    sudo apt-get install aws-neuron-tools -y
    
    # Install Neuron TensorBoard
    pip install tensorboard-plugin-neuron
    
    export PATH=/opt/aws/neuron/bin:$PATH
    
    ######################################################
    #   Only for Ubuntu 20 - Install Python3.7
    #
    # sudo add-apt-repository ppa:deadsnakes/ppa
    # sudo apt-get install python3.7
    #
    ######################################################
    # Install Python venv and activate Python virtual environment to install    
    # Neuron pip packages.
    sudo apt-get install -y python3.7-venv g++
    python3.7 -m venv tensorflow_venv
    source tensorflow_venv/bin/activate
    pip install -U pip
    
    
    # Instal Jupyter notebook kernel 
    pip install ipykernel 
    python3.7 -m ipykernel install --user --name tensorflow_venv --display-name "Python (Neuron TensorFlow)"
    pip install jupyter notebook
    pip install environment_kernels
    
    
    # Set Pip repository  to point to the Neuron repository
    pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com
    
    #Install Neuron TensorFlow
    pip install tensorflow-neuron[cc] "protobuf<4"
    
    # Optional: Install Neuron TensorFlow model server
    sudo apt-get install tensorflow-model-server-neuron --allow-change-held-packages -y
    
  • Enable Neuron Conda enviroment for Neuron Apache MXNet (Incubating):

    Note

    For a successful installation or update, execute each line of the instructions below separately or copy the contents of the code block into a script file and source its contents.

    # Note: There is no DLAMI Conda environment for this framework version
    #       Framework will be installed/updated inside a Python environment
    
    # Update OS packages
    sudo apt-get update -y
    
    ################################################################################################################
    # To install or update to Neuron versions 1.19.1 and newer from previous releases:
    # - DO NOT skip 'aws-neuron-dkms' install or upgrade step, you MUST install or upgrade to latest Neuron driver
    ################################################################################################################
    
    # Install OS headers
    sudo apt-get install linux-headers-$(uname -r) -y
    
    # Install Neuron Driver
    sudo apt-get install aws-neuron-dkms --allow-change-held-packages -y
    
    ####################################################################################
    # Warning: If Linux kernel is updated as a result of OS package update
    #          Neuron driver (aws-neuron-dkms) should be re-installed after reboot
    ####################################################################################
    
    # Install Neuron Tools
    sudo apt-get install aws-neuron-tools -y
    
    export PATH=/opt/aws/neuron/bin:$PATH
    
    # Activate MXNet
    source activate aws_neuron_mxnet_p36
    
    # Set Pip repository  to point to the Neuron repository
    pip config set global.extra-index-url https://pip.repos.neuron.amazonaws.com
    
    #Install Neuron MXNet
    wget https://aws-mx-pypi.s3.us-west-2.amazonaws.com/1.8.0/aws_mx-1.8.0.2-py2.py3-none-manylinux2014_x86_64.whl
    pip install aws_mx-1.8.0.2-py2.py3-none-manylinux2014_x86_64.whl
    pip install mx_neuron neuron-cc
    

Then run the following:

pip install tensorboard-neuron
  • Installing tensorflow-neuron<=1.15.5.1.2.9.0 will automatically install tensorboard-neuron as a dependency. The final version, 1.15.5.1.2.9.0, is part of Neuron v1.12.2 release.

  • To verify tensorboard-neuron is installed correctly, run tensorboard_neuron -h | grep run_neuron_profile. If nothing is shown, please retry installation with the --force-reinstall option.