3

Now that Google Colab is not supporting tensorflow 1.x is there a way to install it through e.g. pip and set up your environment in a similar fashion to what the old %tensorflow_version 1.x did? I really really dont want to rewamp all my code to TF 2

John Doe
  • 83
  • 8
  • 1
    `!pip install tensorflow==1.15` and restart – AloneTogether Aug 04 '22 at 10:41
  • Tensorflow 1 is unsupported in Google Colab. Hence this code `%tensorflow_version 1.x` to convert runtime TF version into 1.x will not work. However you can install TF 1.x using the code mentioned in the above comment - `!pip install tensorflow==1.15` to suffice your code requirement. –  Nov 04 '22 at 12:55
  • Does this answer your question? [Did colab suspend tensorflow 1.x?](https://stackoverflow.com/questions/73215696/did-colab-suspend-tensorflow-1-x) – Anonymous Feb 22 '23 at 19:51

2 Answers2

0

It seems that only tf2 is supported by Colab, but that's not true, you still can use pip to uninstall tf2 and install a specific version of tf1. !yes|pip uninstall tensorflow, !pip install tensorflow==1.15.5 Maybe you should install other dependencies. So use !pip install -r requirements.txt Attention! You must restart the runtime in order to use newly installed versions.

Claude COULOMBE
  • 3,434
  • 2
  • 36
  • 39
0

This issue can be solved by creating a virtual environment using the conda suggested by Atotem in the GitHub Thread.

You can check this thread: issues-3266

Ankit Kr
  • 41
  • 3