我想在Kaggle上使用特定版本的Tensorflow。
# 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__)
Kaggle的输出为:
2.1.0
因此它不会获取我尝试安装的版本。
如何在kaggle上使用2.2.X版以上的版本?
答案 0 :(得分:2)
在有关TPU使用情况的Kaggle文档中,他们指定TensorFlow 2.1支持TPU,因此我想知道是否有可能。您不必卸载TensorFlow,老实说,我不确定卸载是否会有所作为。
这是我在Kaggle笔记本中尝试的内容:
!pip install tensorflow==2.2
出现此错误:
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
给出了相同的错误
但是,!pip install tensorflow
和!pip install tensorflow==2.1
可以工作,但是会安装TensorFlow 2.1。
查看https://www.kaggle.com/docs/tpu以获得更多信息,或者也可以通过电子邮件向他们询问。如果他们只对内核使用TF 2.1,那将是有道理的。