Answers for "install tensorflow colab"

1

colab tensorflow version change

%tensorflow_version 1.x

import tensorflow
print(tensorflow.__version__)
Posted by: Guest on November-18-2020
3

tf 1 compatible colab

Specifying the TensorFlow version
Running 

import tensorflow 

will import the default version (currently 2.x). You can use 1.x 
by running a cell with the 

%tensorflow_version 1.x

magic before you run import tensorflow.
Posted by: Guest on April-26-2020
1

install tensorrt on colab

#Download TensorRT. [from this link, OR, upload the version you want and replace the file name and dl link here]
!wget -O nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.2.2-rc-20190227_1-1_amd64.deb https://www.dropbox.com/s/45pz13r4e8ip4bl/nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.2.2-rc-20190227_1-1_amd64.deb?dl=0
#Install. [rename the .deb file if you donloaded another verion in the 1st and 2nd line below] 
!dpkg -i nv-tensorrt-repo-ubuntu1804-cuda10.0-trt5.1.2.2-rc-20190227_1-1_amd64.deb
!apt-key add /var/nv-tensorrt-repo-cuda10.0-trt5.1.2.2-rc-20190227/7fa2af80.pub
!apt-get update
#not sure if these 2 lines are needed, worked without for me.
#!apt-get install -y --no-install-recommends libnvinfer5=5.1.2-1+cuda10.0
#!apt-get install -y --no-install-recommends libnvinfer-dev=5.1.2-1+cuda10.0
!apt-get install tensorrt
!apt-get install python3-libnvinfer-dev
!apt-get install uff-converter-tf
#Verify installation.
!dpkg -l | grep TensorRT

# i downloaded another version of trt file (cuda11.0-trt7.2.3.4) so for me the output is:
ii  graphsurgeon-tf                                             7.2.3-1+cuda11.0                    amd64        GraphSurgeon for TensorRT package
ii  libnvinfer-dev                                              8.0.0-1+cuda11.3                    amd64        TensorRT development libraries and headers
ii  libnvinfer-plugin-dev                                       8.0.0-1+cuda11.3                    amd64        TensorRT plugin libraries
ii  libnvinfer-plugin8                                          8.0.0-1+cuda11.3                    amd64        TensorRT plugin libraries
ii  libnvinfer8                                                 8.0.0-1+cuda11.3                    amd64        TensorRT runtime libraries
ii  libnvonnxparsers-dev                                        8.0.0-1+cuda11.3                    amd64        TensorRT ONNX libraries
ii  libnvonnxparsers8                                           8.0.0-1+cuda11.3                    amd64        TensorRT ONNX libraries
ii  libnvparsers-dev                                            8.0.0-1+cuda11.3                    amd64        TensorRT parsers libraries
ii  libnvparsers8                                               8.0.0-1+cuda11.3                    amd64        TensorRT parsers libraries
ii  python3-libnvinfer                                          8.0.0-1+cuda11.3                    amd64        Python 3 bindings for TensorRT
ii  python3-libnvinfer-dev                                      8.0.0-1+cuda11.3                    amd64        Python 3 development package for TensorRT
ii  uff-converter-tf                                            7.2.3-1+cuda11.0                    amd64        UFF converter for TensorRT package
Posted by: Guest on May-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language