我想在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版及更高版本?
在有关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,那将是有道理的。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句