Why can't colab run tensorflow 1.14.0 version anymore? - google-colaboratory

I tried running...
!pip install tensorflow==1.14.0
I tried different ways to do so.
%tensorflow_version 1.x
!pip uninstall -y tensorflow
!pip install tensorflow-gpu==1.14.0
ValueError: Tensorflow 1 is unsupported in Colab.
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
ERROR: Could not find a version that satisfies the requirement tensorflow==1.14 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0)
ERROR: No matching distribution found for tensorflow==1.14

Related

Kernel crashes when I use tensorflow

I created my anaconda environment and installed a few modules on it (see below full list) notably tensorflow and matplotlib
(FreeCodeCampML) C:\Users\abelm>conda list
# packages in environment at C:\Users\abelm\anaconda3\envs\FreeCodeCampML:
#
# Name Version Build Channel
_tflow_select 2.3.0 mkl
absl-py 1.4.0 pyhd8ed1ab_0 conda-forge
aiohttp 3.8.1 py310he2412df_1 conda-forge
aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge
anyio 3.5.0 py310haa95532_0
appdirs 1.4.4 pyhd3eb1b0_0
argon2-cffi 21.3.0 pyhd3eb1b0_0
argon2-cffi-bindings 21.2.0 py310h2bbff1b_0
asttokens 2.0.5 pyhd3eb1b0_0
astunparse 1.6.3 pyhd8ed1ab_0 conda-forge
async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge
attrs 22.1.0 py310haa95532_0
babel 2.11.0 py310haa95532_0
backcall 0.2.0 pyhd3eb1b0_0
beautifulsoup4 4.11.1 py310haa95532_0
blas 1.0 mkl
bleach 4.1.0 pyhd3eb1b0_0
blinker 1.5 pyhd8ed1ab_0 conda-forge
bottleneck 1.3.5 py310h9128911_0
brotli 1.0.9 h2bbff1b_7
brotli-bin 1.0.9 h2bbff1b_7
brotlipy 0.7.0 py310h2bbff1b_1002
bzip2 1.0.8 he774522_0
ca-certificates 2022.12.7 h5b45459_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
cachetools 5.3.0 pyhd8ed1ab_0 conda-forge
certifi 2022.12.7 pyhd8ed1ab_0 conda-forge
cffi 1.15.1 py310h2bbff1b_3
charset-normalizer 2.0.4 pyhd3eb1b0_0
click 8.1.3 win_pyhd8ed1ab_2 conda-forge
colorama 0.4.6 py310haa95532_0
comm 0.1.2 py310haa95532_0
cryptography 38.0.4 py310h21b164f_0
cycler 0.11.0 pyhd3eb1b0_0
debugpy 1.5.1 py310hd77b12b_0
decorator 5.1.1 pyhd3eb1b0_0
defusedxml 0.7.1 pyhd3eb1b0_0
entrypoints 0.4 py310haa95532_0
executing 0.8.3 pyhd3eb1b0_0
fftw 3.3.9 h2bbff1b_1
flatbuffers 2.0.0 h6c2663c_0
flit-core 3.6.0 pyhd3eb1b0_0
fonttools 4.25.0 pyhd3eb1b0_0
freetype 2.12.1 ha860e81_0
frozenlist 1.3.3 py310h2bbff1b_0
gast 0.4.0 pyh9f0ad1d_0 conda-forge
giflib 5.2.1 h8d14728_2 conda-forge
glib 2.69.1 h5dc1a3c_2
google-auth 2.16.0 pyh1a96a4e_1 conda-forge
google-auth-oauthlib 0.4.6 pyhd8ed1ab_0 conda-forge
google-pasta 0.2.0 pyh8c360ce_0 conda-forge
grpcio 1.42.0 py310hc60d5dd_0
gst-plugins-base 1.18.5 h9e645db_0
gstreamer 1.18.5 hd78058f_0
h5py 3.7.0 nompi_py310h00cbb18_100 conda-forge
hdf5 1.12.1 nompi_h2a0e4a3_100 conda-forge
icc_rt 2022.1.0 h6049295_2
icu 58.2 ha925a31_3
idna 3.4 py310haa95532_0
importlib-metadata 6.0.0 pyha770c72_0 conda-forge
intel-openmp 2021.4.0 haa95532_3556
ipykernel 6.19.2 py310h9909e9c_0
ipython 8.8.0 py310haa95532_0
ipython_genutils 0.2.0 pyhd3eb1b0_1
ipywidgets 7.6.5 pyhd3eb1b0_1
jedi 0.18.1 py310haa95532_1
jinja2 3.1.2 py310haa95532_0
jpeg 9e h2bbff1b_0
json5 0.9.6 pyhd3eb1b0_0
jsonschema 4.16.0 py310haa95532_0
jupyter 1.0.0 py310haa95532_8
jupyter_client 7.4.9 py310haa95532_0
jupyter_console 6.4.4 py310haa95532_0
jupyter_core 5.1.1 py310haa95532_0
jupyter_server 1.23.4 py310haa95532_0
jupyterlab 3.5.3 py310haa95532_0
jupyterlab_pygments 0.1.2 py_0
jupyterlab_server 2.16.5 py310haa95532_0
jupyterlab_widgets 1.0.0 pyhd3eb1b0_1
keras 2.10.0 py310haa95532_0 anaconda
keras-preprocessing 1.1.2 pyhd3eb1b0_0
kiwisolver 1.4.4 py310hd77b12b_0
lerc 3.0 hd77b12b_0
libbrotlicommon 1.0.9 h2bbff1b_7
libbrotlidec 1.0.9 h2bbff1b_7
libbrotlienc 1.0.9 h2bbff1b_7
libclang 12.0.0 default_h627e005_2
libcurl 7.87.0 h86230a5_0
libdeflate 1.8 h2bbff1b_5
libffi 3.4.2 hd77b12b_6
libiconv 1.16 h2bbff1b_2
libogg 1.3.5 h2bbff1b_1
libpng 1.6.37 h2a8f88b_0
libprotobuf 3.20.3 h23ce68f_0
libsodium 1.0.18 h62dcd97_0
libssh2 1.10.0 h680486a_2 conda-forge
libtiff 4.5.0 h6c2663c_1
libvorbis 1.3.7 he774522_0
libwebp 1.2.4 h2bbff1b_0
libwebp-base 1.2.4 h2bbff1b_0
libxml2 2.9.14 h0ad7f3c_0
libxslt 1.1.35 h2bbff1b_0
lxml 4.9.1 py310h1985fb9_0
lz4-c 1.9.4 h2bbff1b_0
markdown 3.4.1 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py310h2bbff1b_0
matplotlib 3.5.3 py310h5588dad_2 conda-forge
matplotlib-base 3.5.3 py310hd77b12b_0
matplotlib-inline 0.1.6 py310haa95532_0
mistune 0.8.4 py310h2bbff1b_1000
mkl 2021.4.0 haa95532_640
mkl-service 2.4.0 py310h2bbff1b_0
mkl_fft 1.3.1 py310ha0764ea_0
mkl_random 1.2.2 py310h4ed8f06_0
multidict 6.0.2 py310h2bbff1b_0
munkres 1.1.4 py_0
nbclassic 0.4.8 py310haa95532_0
nbclient 0.5.13 py310haa95532_0
nbconvert 6.5.4 py310haa95532_0
nbformat 5.7.0 py310haa95532_0
nest-asyncio 1.5.6 py310haa95532_0
notebook 6.5.2 py310haa95532_0
notebook-shim 0.2.2 py310haa95532_0
numexpr 2.8.4 py310hd213c9f_0
numpy 1.23.5 py310h60c9a35_0
numpy-base 1.23.5 py310h04254f7_0
oauthlib 3.2.2 pyhd8ed1ab_0 conda-forge
openssl 1.1.1t h2bbff1b_0
opt_einsum 3.3.0 pyhd8ed1ab_1 conda-forge
packaging 22.0 py310haa95532_0
pandas 1.5.2 py310h4ed8f06_0
pandocfilters 1.5.0 pyhd3eb1b0_0
parso 0.8.3 pyhd3eb1b0_0
pcre 8.45 hd77b12b_0
pickleshare 0.7.5 pyhd3eb1b0_1003
pillow 9.3.0 py310hd77b12b_2
pip 22.3.1 py310haa95532_0
platformdirs 2.5.2 py310haa95532_0
ply 3.11 py310haa95532_0
pooch 1.4.0 pyhd3eb1b0_0
prometheus_client 0.14.1 py310haa95532_0
prompt-toolkit 3.0.36 py310haa95532_0
prompt_toolkit 3.0.36 hd3eb1b0_0
protobuf 3.20.3 py310hd77b12b_0
psutil 5.9.0 py310h2bbff1b_0
pure_eval 0.2.2 pyhd3eb1b0_0
pyasn1 0.4.8 py_0 conda-forge
pyasn1-modules 0.2.7 py_0 conda-forge
pycparser 2.21 pyhd3eb1b0_0
pygments 2.11.2 pyhd3eb1b0_0
pyjwt 2.6.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd3eb1b0_0
pyparsing 3.0.9 py310haa95532_0
pyqt 5.15.7 py310hd77b12b_0
pyqt5-sip 12.11.0 py310hd77b12b_0
pyrsistent 0.18.0 py310h2bbff1b_0
pysocks 1.7.1 py310haa95532_0
python 3.10.9 h966fe2a_0
python-dateutil 2.8.2 pyhd3eb1b0_0
python-fastjsonschema 2.16.2 py310haa95532_0
python-flatbuffers 23.1.21 pyhd8ed1ab_0 conda-forge
python_abi 3.10 2_cp310 conda-forge
pytz 2022.7 py310haa95532_0
pyu2f 0.1.5 pyhd8ed1ab_0 conda-forge
pywin32 305 py310h2bbff1b_0
pywinpty 2.0.2 py310h5da7b33_0
pyzmq 23.2.0 py310hd77b12b_0
qt-main 5.15.2 he8e5bd7_7
qt-webengine 5.15.9 hb9a9bb5_5
qtconsole 5.4.0 pypi_0 pypi
qtpy 2.2.0 py310haa95532_0
qtwebkit 5.212 h3ad3cdb_4
requests 2.28.1 py310haa95532_0
requests-oauthlib 1.3.1 pyhd8ed1ab_0 conda-forge
rsa 4.9 pyhd8ed1ab_0 conda-forge
scipy 1.10.0 py310hb9afe5d_0
send2trash 1.8.0 pyhd3eb1b0_1
setuptools 65.6.3 py310haa95532_0
sip 6.6.2 py310hd77b12b_0
six 1.16.0 pyhd3eb1b0_1
snappy 1.1.9 h82413e6_1 conda-forge
sniffio 1.2.0 py310haa95532_1
soupsieve 2.3.2.post1 py310haa95532_0
sqlite 3.40.1 h2bbff1b_0
stack_data 0.2.0 pyhd3eb1b0_0
tensorboard 2.10.0 py310haa95532_0
tensorboard-data-server 0.6.1 py310haa95532_0
tensorboard-plugin-wit 1.8.1 pyhd8ed1ab_0 conda-forge
tensorflow 2.10.0 mkl_py310hd99672f_0
tensorflow-base 2.10.0 mkl_py310h6a7f48e_0
tensorflow-estimator 2.10.0 py310haa95532_0
termcolor 2.2.0 pyhd8ed1ab_0 conda-forge
terminado 0.17.1 py310haa95532_0
tinycss2 1.2.1 py310haa95532_0
tk 8.6.12 h2bbff1b_0
toml 0.10.2 pyhd3eb1b0_0
tomli 2.0.1 py310haa95532_0
tornado 6.2 py310h2bbff1b_0
traitlets 5.7.1 py310haa95532_0
typing-extensions 4.4.0 py310haa95532_0
typing_extensions 4.4.0 py310haa95532_0
tzdata 2022g h04d1e81_0
urllib3 1.26.14 py310haa95532_0
vc 14.2 h21ff451_1
vs2015_runtime 14.27.29016 h5e58377_2
wcwidth 0.2.5 pyhd3eb1b0_0
webencodings 0.5.1 py310haa95532_1
websocket-client 0.58.0 py310haa95532_4
werkzeug 2.2.2 pyhd8ed1ab_0 conda-forge
wheel 0.37.1 pyhd3eb1b0_0
widgetsnbextension 3.5.2 py310haa95532_0
win_inet_pton 1.1.0 py310haa95532_0
wincertstore 0.2 py310haa95532_2
winpty 0.4.3 4
wrapt 1.14.1 py310he2412df_0 conda-forge
xz 5.2.10 h8cc25b3_1
yarl 1.7.2 py310he2412df_2 conda-forge
zeromq 4.3.4 hd77b12b_0
zipp 3.13.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.13 h8cc25b3_0
zstd
When I run my code (see just below), I got the following error: "Canceled future for execute_request message before replies were done
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details."
model = models.Sequential()
model.add(layers.Conv2D(32, (3,3), activation='relu', input_shape=(32, 32, 3))) #32 represents number of filters and (3,3) the size of the filters
model.add(layers.MaxPooling2D((2,2)))
model.add(layers.Conv2D(64, (3,3), activation='relu'))
model.add(layers.MaxPooling2D((2,2)))
model.add(layers.Conv2D(64, (3,3),activation='relu'))
The first blocks of my code (which work fine) are as followed:
import tensorflow as tf
from tensorflow.keras import datasets, layers, models
import matplotlib.pyplot as plt
(train_images, train_labels), (test_images, test_labels) = datasets.cifar10.load_data()
#Normalize pixel values to be between 0 and 1
train_images, test_images = train_images / 255, test_images
class_names = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
IMG_INDEX = 69
plt.imshow(train_images[IMG_INDEX], cmap=plt.cm.binary)
plt.xlabel(class_names[train_labels[IMG_INDEX][0]])
plt.show()
So I followed the instruction and tried to reinstall tensorflow. I also created a new environment to just have tensorflow and matplotlib as the modules I manually installed (fearing that other modules that I installed might interfere with the tensorflow one). I also used another environment with an older python version (3.9.16 instead of 3.10.9) Nothing worked
The instructions I followed come from github: "
If a kernel crashes when using tensorflow, this is indicative of tensorflow having been incorrectly installed into the Python Environment. Re-installing the package would resolve the issue.
If this does not work, it is also possible other dependent packages could cause the package to fall over, in such cases, its best to start out with a new environment.
Finally, when using Conda environments, please avoid using pip to install packages, instead use conda install.
Originally filed here https://github.com/microsoft/vscode-jupyter/issues/9283 and here https://github.com/microsoft/vscode-jupyter/issues/9157
Could you guys help ?

Tensorflow=2.11 version not found when installing

I have python 3.10.6 installed.
i am following the TFOD course
i installed TensorFlow 2.11
while training the mode the gpu was not being used and therefore the process was very slow.
then i installed CUDA 11.2 and Cudnn 8.1
but when i installed tensorflow-gpu 2.11.0 it says
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==2.11 (from versions: 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1)
ERROR: No matching distribution found for tensorflow-gpu==2.11
alter
I tried uninstalling TensorFlow 2.11 and installing 2.10,
and installed tensorflow2.10.0.
Did not update cuda and cudnn as same versions were required
I was hoping that it would run on GPU this time. but it did not

How to import TF1 in google colab

Trying to train custom dataset using TensorFlow object detection API -RCNN: TensorFlow 1.
Colab notebooks discontinued support for tf1.
How to import tf1 in google colab?
!python -m pip install pip==19.0
!pip uninstall tensorflow
!pip install tensorflow==1.15
Console:
Collecting tensorflow==1.15
Could not find a version that satisfies the requirement tensorflow==1.15 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0rc0, 2.6.0rc1, 2.6.0rc2, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4)
No matching distribution found for tensorflow==1.15

couldn't downgrade tensorflow in colab (just version 2 is available)

Colab does not allow to downgrade TensorFlow and says that only versions 2 is available.
here is code and output:
!pip install tensorflow-gpu==1.15.2
import tensorflow as tf
print(tf.__version__)
output:
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==1.15.2 (from versions: 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.11.0rc0, 2.11.0rc1, 2.11.0rc2, 2.11.0)
ERROR: No matching distribution found for tensorflow-gpu==1.15.2
2.9.2
I tried this code by creating some new projects in Colab but I got no new results
To downgrade tensorflow in google colab you must downgrade the version of python because python3.8 is not compatible with tensorflow1.x. So, Downgrade the version of python to python3.7 and install tensorflow1.x. This will work.
1.At first, Install python==3.7 version.
!sudo apt-get update -y
!sudo apt-get install python3.7
#change alternatives
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
!sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
#check python version
!python --version
The above code will install python3.7 version, but it is not mapped to colab kernel, so we must map newly installed python.
# install pip for python==3.7
!sudo apt-get install python3.7-distutils
!wget https://bootstrap.pypa.io/get-pip.py
!python get-pip.py
# install colab dependencies
!python -m pip install ipython ipython_genutils ipykernel jupyter_console prompt_toolkit httplib2 astor
# link to the old google package
!ln -s /usr/local/lib/python3.8/dist-packages/google \
/usr/local/lib/python3.7/dist-packages/google
Let's check version of python again, it will be python==3.7.16:
!python --version
Now, it's time to install tensorflow 1.x.
!pip install tensorflow==1.x
I hope that it will help to fix your issue.Thank you!

0 Can we install tensorflow==0.11.0rc0 version in colab

Can we install tensorflow==0.11.0rc0 version in colab , as one of the pre-trained model code I use is coded in this version
You can install any version of TensorFlow in google collab.
However, there are specific versions that are available, so you may want to pick from those options . version 0.11.0rc0 is not currently available.
!pip install tensorflow==1.1.0rc0. #install a tensorflow version
import tensorflow as tf # import tensorflow
print(tf.__version__). # print tensorflow version
Here is the list of available versions as of now.
0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 1.15.2, 1.15.3, 2.0.0a0, 2.0.0b0, 2.0.0b1, 2.0.0rc0, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2, 2.1.0, 2.1.1, 2.2.0rc0, 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0