This document is relevant for: Inf1

Install TensorFlow Neuron (Neuron 1.15.0)#

Develop on AWS ML accelerator instance#

The simplest environment setup for model development installs all Neuron SDK components directly on an AWS ML accelerator instance: the Neuron framework extensions, compiler, runtime, and tools. This will allow you to compile, execute, and performance tune your model, all in the same instance. This is the recommended workflow when first starting to work with Neuron device or when optimizing a model.

Note: If you are using a regular U18, U20, or AL2 AMI, follow the same setup instructions as the Base DLAMIs respectively.

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

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


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.5.0.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.5.1.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.5.0.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.5.1.1.6.8.0 -y

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.

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Activate TensorFlow
source activate 

# 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]==2.5.0.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.5.1.1.6.8.0 --allow-change-held-packages -y

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.

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Activate TensorFlow
source activate 

# 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]==2.5.0.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.5.1.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

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


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.4.2.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.4.1.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.4.2.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.4.1.1.6.8.0 -y

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.

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Activate TensorFlow
source activate 

# 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]==2.4.2.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.4.1.1.6.8.0 --allow-change-held-packages -y

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.

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Activate TensorFlow
source activate 

# 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]==2.4.2.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.4.1.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

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


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.3.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.3.0.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.3.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.3.0.1.6.8.0 -y

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.

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Activate TensorFlow
source activate 

# 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]==2.3.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.3.0.1.6.8.0 --allow-change-held-packages -y

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.

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Activate TensorFlow
source activate 

# 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]==2.3.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.3.0.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

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


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.2.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.2.2.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.2.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.2.2.1.6.8.0 -y

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

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

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


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.2.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.2.2.1.6.8.0 --allow-change-held-packages -y

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 yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.2.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.2.2.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

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


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.1.4.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.1.4.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.1.4.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.1.4.1.6.8.0 -y

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

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

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


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.1.4.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.1.4.1.6.8.0 --allow-change-held-packages -y

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 yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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]==2.1.4.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.1.4.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

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


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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==1.15.5.1.6.8.0 neuron-cc==1.6.13.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=1.15.0.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# Instal Jupyter notebook kernel 
pip install ipykernel 
python3.6 -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==1.15.5.1.6.8.0 neuron-cc==1.6.13.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-1.15.0.1.6.8.0 -y

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.

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-tools=1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Activate TensorFlow
source activate aws_neuron_tensorflow_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 TensorFlow
pip install tensorflow-neuron==1.15.5.1.6.8.0 neuron-cc==1.6.13.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=1.15.0.1.6.8.0 --allow-change-held-packages -y

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.

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

# Install Neuron Tools
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-tools-1.7.20.0 -y

# Install Neuron TensorBoard
pip install tensorboard-plugin-neuron==2.1.2.0

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

# Activate TensorFlow
source activate aws_neuron_tensorflow_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 TensorFlow
pip install tensorflow-neuron==1.15.5.1.6.8.0 neuron-cc==1.6.13.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-1.15.0.1.6.8.0 -y

Compile on compute instance#

If model compilation occurs outside the model deployment environment, you can install only the Neuron framework extensions and the compiler on any compute instance. This setup is helpful when compiling large complex models that require large amount of memory or during a CICD process where models are compiled in a separate step, prior to deployment.

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.

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


# 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]==2.5.0.1.6.8.0 "protobuf"

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.

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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]==2.5.0.1.6.8.0 "protobuf"

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.

# Activate TensorFlow
source activate 

# 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]==2.5.0.1.6.8.0 "protobuf"

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.

# Activate TensorFlow
source activate 

# 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]==2.5.0.1.6.8.0 "protobuf"

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.

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


# 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]==2.4.2.1.6.8.0 "protobuf"

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.

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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]==2.4.2.1.6.8.0 "protobuf"

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.

# Activate TensorFlow
source activate 

# 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]==2.4.2.1.6.8.0 "protobuf"

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.

# Activate TensorFlow
source activate 

# 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]==2.4.2.1.6.8.0 "protobuf"

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.

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


# 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]==2.3.3.1.6.8.0 "protobuf"

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.

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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]==2.3.3.1.6.8.0 "protobuf"

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.

# Activate TensorFlow
source activate 

# 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]==2.3.3.1.6.8.0 "protobuf"

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.

# Activate TensorFlow
source activate 

# 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]==2.3.3.1.6.8.0 "protobuf"

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.

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


# 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]==2.2.3.1.6.8.0 "protobuf"

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.

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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]==2.2.3.1.6.8.0 "protobuf"

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

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


# 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]==2.2.3.1.6.8.0 "protobuf"

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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]==2.2.3.1.6.8.0 "protobuf"

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.

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


# 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]==2.1.4.1.6.8.0 "protobuf"

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.

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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]==2.1.4.1.6.8.0 "protobuf"

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

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


# 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]==2.1.4.1.6.8.0 "protobuf"

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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]==2.1.4.1.6.8.0 "protobuf"

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.

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


# 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==1.15.5.1.6.8.0 neuron-cc==1.6.13.0 "protobuf"

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.

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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==1.15.5.1.6.8.0 neuron-cc==1.6.13.0 "protobuf"

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.

# Activate TensorFlow
source activate aws_neuron_tensorflow_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 TensorFlow
pip install tensorflow-neuron==1.15.5.1.6.8.0 neuron-cc==1.6.13.0 "protobuf"

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.

# Activate TensorFlow
source activate aws_neuron_tensorflow_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 TensorFlow
pip install tensorflow-neuron==1.15.5.1.6.8.0 neuron-cc==1.6.13.0 "protobuf"

Deploy on AWS ML accelerator instance#

During deployment it can be beneficial to reduce the number of components installed in the system. For use-cases where only inference is necessary (compilation is already complete), only the framework and runtime should be installed.

Note: If you are using a regular U18, U20, or AL2 AMI, follow the same setup instructions as the Base DLAMIs respectively.

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

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


# 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==2.5.0.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.5.1.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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==2.5.0.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.5.1.1.6.8.0 -y

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.

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

# Activate TensorFlow
source activate 

# 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==2.5.0.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.5.1.1.6.8.0 --allow-change-held-packages -y

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.

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Activate TensorFlow
source activate 

# 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==2.5.0.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.5.1.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

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


# 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==2.4.2.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.4.1.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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==2.4.2.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.4.1.1.6.8.0 -y

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.

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

# Activate TensorFlow
source activate 

# 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==2.4.2.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.4.1.1.6.8.0 --allow-change-held-packages -y

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.

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Activate TensorFlow
source activate 

# 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==2.4.2.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.4.1.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

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


# 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==2.3.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.3.0.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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==2.3.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.3.0.1.6.8.0 -y

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.

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

# Activate TensorFlow
source activate 

# 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==2.3.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.3.0.1.6.8.0 --allow-change-held-packages -y

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.

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Activate TensorFlow
source activate 

# 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==2.3.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.3.0.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

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


# 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==2.2.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.2.2.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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==2.2.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.2.2.1.6.8.0 -y

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

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

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


# 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==2.2.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.2.2.1.6.8.0 --allow-change-held-packages -y

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 yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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==2.2.3.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.2.2.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

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


# 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==2.1.4.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.1.4.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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==2.1.4.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-2.1.4.1.6.8.0 -y

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

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

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


# 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==2.1.4.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=2.1.4.1.6.8.0 --allow-change-held-packages -y

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 yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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==2.1.4.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-2.1.4.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
. /etc/os-release
sudo tee /etc/apt/sources.list.d/neuron.list > /dev/null <<EOF
deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main
EOF
wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | sudo apt-key add -

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 -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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

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


# 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==1.15.5.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=1.15.0.1.6.8.0 -y

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.

# Configure Linux for Neuron repository updates
sudo tee /etc/yum.repos.d/neuron.repo > /dev/null <<EOF
[neuron]
name=Neuron YUM Repository
baseurl=https://yum.repos.neuron.amazonaws.com
enabled=1
metadata_expire=0
EOF
sudo rpm --import https://yum.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Install Python venv and activate Python virtual environment to install    
# Neuron pip packages.
sudo yum install -y python3.6-venv gcc-c++
python3.6 -m venv tensorflow_venv
source tensorflow_venv/bin/activate
pip install -U pip


# 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==1.15.5.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install tensorflow-model-server-neuron-1.15.0.1.6.8.0 -y

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.

# Update OS packages
sudo apt-get update -y

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

# Install Neuron Driver
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-dkms=2.0.450.0 --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 Runtime server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install aws-neuron-runtime=1.6.19.0 -y

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

# Activate TensorFlow
source activate aws_neuron_tensorflow_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 TensorFlow
pip install tensorflow-neuron==1.15.5.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version, please add '--allow-downgrades' option to 'sudo apt-get install' 
sudo apt-get install tensorflow-model-server-neuron=1.15.0.1.6.8.0 --allow-change-held-packages -y

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.

# Update OS packages
sudo yum update -y

# Install OS headers
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) -y

# Install Neuron Driver
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete aws-neuron-dkms
sudo yum install aws-neuron-dkms-2.0.450.0 -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 Runtime server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum install aws-neuron-runtime-1.6.19.0 -y

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

# Activate TensorFlow
source activate aws_neuron_tensorflow_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 TensorFlow
pip install tensorflow-neuron==1.15.5.1.6.8.0 "protobuf"

# Optional: Install Neuron TensorFlow model server
# If you are downgrading from newer version , please remove existing package using 'sudo yum remove' before installing the older package
sudo yum versionlock delete tensorflow-model-server-neuron
sudo yum install tensorflow-model-server-neuron-1.15.0.1.6.8.0 -y

This document is relevant for: Inf1