Error installing tensorflow 2.2 on Colab as well as Anaconda

Hello! I am getting following error while installing tensorflow 2.2. I have tried it on both Anaconda and Colab - got same error. Using tensorflow >2.2.0 is causing the submission to fail. Please help.

Looking in indexes: Simple index, https://us-python.pkg.dev/colab-wheels/public/simple/
ERROR: Could not find a version that satisfies the requirement tensorflow==2.2 (from versions: 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, 2.12.0rc0, 2.12.0rc1)
ERROR: No matching distribution found for tensorflow==2.2

I’ve encountered the same problem. In short, we cannot use Colab for this. Regarding Anaconda, what you could do is install tensorflow 2.1.0 using conda, and then use pip to install 2.2.0.

Reading other posts, it looks like that has worked for some. However, I eventually run into problems with package competencies that don’t let me work on the assignment.

Thanks @Jan_Danel . As you suggested, I tried installing tensorflow 2.1.0 in conda, but it did not like my python version. I have python 3.9 and it wants python 3.6.x/3.7.x. So I tried installing python 3.7.x but conda got stuck with that.

@Girijesh please help. I have already submitted my assignment once but it came back with “invalid submission” error. I think the reason is this tensorflow version. I have tried installing tensorflow 2.2 using both conda and colab and both failed. Please tell how to create the right environment for this assignment.

Dear Seema,
Can you please email me your notebook.

@Girijesh would you mind seeing my notebook as well? I’m able to complete it successfully with higher version of tensorflow but not with 2.1.0 or 2.2.0. For these lower versions I keep encountering package errors.

Dear @Jan_Danel,
Why not. Please email me your notebook.

I am having problems with this assignment as well. The lowest version of tensorflow available is 2.8. I succeeded finishing the assignment under tensorflow 2.11 but the grader failed me. Help please.

@xxon , Jan_Danel suggested a solution in his post “C1W3 Run the Tensorflow.js Converter on the Saved Keras Model Error”. That worked like a charm and I could complete the assignment. You may want to try that.

Tried this. I still get the error that tensorflow 2.8 is the oldest version.

That’s strange … I had followed the steps on conda prompt and then invoked jupyter notebook from the same prompt, it printed tensorflow version as 2.2.0 as expected.

1 Like

Even after explicitly loading tensorflow==2.8 in the notebook, it shows:
Using TensorFlow Version: 2.11.0

On the command line when I run pip install tensorflow-cpu==2.2.0 I get:
ERROR: Could not find a version that satisfies the requirement tensorflow-cpu==2.2.0 (from versions: 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, 2.12.0rc0, 2.12.0rc1)
ERROR: No matching distribution found for tensorflow-cpu==2.2.0

EDIT: I am using venv, not conda if that matters.

These are the exact steps I ran on my conda prompt:

conda create -n tf210 tensorflow=2.1.0 python=3.7
conda activate tf210
pip install tensorflow-intel==0.0.1
pip install tensorflow-cpu==2.1.0
pip install tensorflow-estimator==2.1.0rc0
pip install tensorflow==2.2.0
jupyter notebook

I could see some error messages in this setup, but it seems those didn’t matter. In the assignment jupyter notebook, I simply imported tensorflow (no pip command) and I could see 2.2.0 version.

Hope it helps.

1 Like

I think it might work. I’ll let you know.

I am still getting from the grader:

The model in your submission is invalid. Please try again!

Still get an invalid model in the grader, I have tries all kinds of workarounds with no luck. I tried many remedies in “One solution to outstanding “Model submission is invalid” bug” but I can’t make this assignment work.

I tried your code but it gives me a syntax error

Thanks @Seema_Naswa but no luck. Any other suggestions out there?

@Osama_Saad_Farouk, you have to run the code line by line in anaconda prompt, not in a jupyter lab.

When you download anaconda, you should have access to an anaconda prompt which is similar to a cmd. Then, when you open the anaconda navigator, you should be able to see the new environment called tf210 and be able to launch a jupyter notebook with it.

2 Likes

@xxon, my only suggestion is to try it out on anaconda. You stated that you are using venv earlier. So, if you haven’t done it already, I’ll recommend getting anaconda to finish this assignment and course because it is simple to download/install.

I also found this assignment frustrating and it took me a few days to figure out. Hopefully using Seema_Naswa’s conda prompt code, you’ll be able to successfully complete the assignment. It worked for Seema and myself so it should work for you too.

I used these commands but when I installed tensorflowjs it automatically installs tensorflow version 2.9

I have since downloaded and installed anaconda and followed the suggested prompts from Seema_Naswa. I activated tf210 prior to starting jupyter notebook. Everything works until I submit to the grader, it always returns the model is invalid.

UPDATE: I figured this out…

I switched environments from venv to anaconda. Somewhere in this mix I installed jupyter globally, not just inside the tf210 environment. Once I uninstalled the global version of jupyter and installed it properly in the anaconda environment all my problems went away. The version cell in the notebook displays tensorflow 2.2.0 as expected.

Thanks all for the help!