1

I would like to use a specific version of Tensorflow on Kaggle.

# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load in 
!pip uninstall tensorflow -y
!pip install -q tensorflow-datasets tf-nightly==2.2.0-dev20200319
import tensorflow as tf
import tensorflow_datasets as tfds
import os
# Input data files are available in the "../input/" directory.
# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory

print(tf.__version__)

And the output on Kaggle is:

2.1.0

So it is not picking up the version I have tried to install.

How can I use version 2.2.X onwards on kaggle?

1 Answer 1

2

In the Kaggle documentation on TPU usage, they specify that TPU's are supported through TensorFlow 2.1, so I'm wondering if it's even possible. You shouldn't have to uninstall TensorFlow, and honestly I'm not sure if uninstalling will make a difference.

Here's what I tried in a Kaggle notebook:

!pip install tensorflow==2.2 gave this error:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a69b080>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a69bba8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a5f7160>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a5f7128>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7f407a5f72e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/tensorflow/
ERROR: Could not find a version that satisfies the requirement tensorflow==2.2 (from versions: none)
ERROR: No matching distribution found for tensorflow==2.2

!pip install tensorflow==1.1 gave the same error

However, !pip install tensorflow and !pip install tensorflow==2.1 works, however it installs TensorFlow 2.1.

Check out https://www.kaggle.com/docs/tpu for further information, or it might also be worth emailing them and asking. It would make sense if they only use TF 2.1 though for their kernels.

Not the answer you're looking for? Browse other questions tagged or ask your own question.