-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtensorflow_downgrading
42 lines (23 loc) · 1.44 KB
/
tensorflow_downgrading
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Commands for downgrading Tensorflow to a specific version
#Python has to be downgraded before installing Tensorflow(TF), if the TF version is not available for the default Python version.
#Adds external APT repository
!add-apt-repository -y 'ppa:deadsnakes/ppa'
#Installs specific python version
!apt install -y python3.8
#Installs distutils package for the specific python version
!apt-get install -y python3.8-distutils
#Installs Tensorflow specific version using the newly installed Python version
!sudo /usr/bin/python3.8 -m pip install -Iv tensorflow==2.7.0
#Downgrades protobuf to a suitable version
!sudo /usr/bin/python3.8 -m pip install protobuf==3.19.1
#Commands for Network Repo Installation for Ubuntu
#Replace "ubuntu2004" with "debian11", "ubuntu1804" or "ubuntu2204" for respective versions in the following commands
!wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
!sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
!sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
!sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /" -y
!sudo apt-get update -y
#Install specific versions of cuddn and cuda.
!sudo apt-get install libcudnn8=8.1.*-1+cuda11.2
#Run a training script after the installation of dependencies
!/usr/bin/python3.8 train.py