googlecolab / colabtools

Python libraries for Google Colaboratory
Apache License 2.0
2.2k stars 722 forks source link

Upgrade to tensorflow 2.17.0 and keras 3.4.1 #4744

Closed mayankmalik-colab closed 1 month ago

mayankmalik-colab commented 3 months ago

Upgrade to tensorflow 2.17.0 and keras 3.4.1

The Colab CPU/GPU runtimes are going to be upgraded to tensorflow 2.17.0 and keras 3.4.1 this week. TPU runtimes will still be on tensorflow 2.15 for sometime. Please upgrade your notebooks to be compatible with the changes.

Colab’s fallback runtime version Using the fallback runtime version temporarily allows access to the last version of the runtime before the upgrade described above, and is available until mid Aug. Its purpose is to provide a temporary mechanism for users to more smoothly upgrade their notebooks to be compatible with Colab’s current runtime version. This will be available from the Command Palette via the "Use fallback runtime version" command when connected to a runtime. Of note, this setting does not persist across sessions – the command will need to be invoked on each new session.

amitbagate commented 3 months ago

Thanks for announcement!

Tensorflow 2.17.0 and keras 3.4.1 are not compatible with Tensorflow Profitability.

My code was working fine till Wednesday IST and since yesterday my model started to throw error. Below is the snippet

------------------------------------------------------Colab Verbose----------------------------------

AttributeError Traceback (most recent call last) in <cell line: 5>() 3 drop_out=0.50 4 mse_loss = keras.losses.MeanSquaredError() ----> 5 bnn_model_full = create_full_bnn_model(40, [8, 8], 1/train_size)

/usr/local/lib/python3.10/dist-packages/tf_keras/src/engine/input_spec.py in assert_input_compatibility(input_spec, inputs, layer_name) 249 ) 250 if spec.min_ndim is not None: --> 251 ndim = x.shape.rank 252 if ndim is not None and ndim < spec.min_ndim: 253 raise ValueError(

AttributeError: 'tuple' object has no attribute 'rank

-------------------------------------------------------------------------------------------------------------------

Is there any solution to this?

Please suggest.

Thanks! amit

sagelywizard commented 2 months ago

Hey Amit! You can use the fallback runtime version mentioned in the announcement description to continue using TF 2.15 for the time being.