可以在Kaggle TPU上安装早期版本的tensorflow吗?

2024-06-17 12:05:56 发布

您现在位置:Python中文网/ 问答频道 /正文

Kaggle TPU切换到tf 2.3.1。 但我需要TF2.2.0

我试过:

!pip install tensorflow~=2.2.0

Tensorflow切换到2.2.1。但我得到了一个错误:

InvalidArgumentError: NodeDef expected inputs 'string' do not match 0 inputs specified; Op ; attr=T:type; attr=tensor_name:string; attr=send_device:string; attr=send_device_incarnation:int; attr=recv_device:string; attr=client_terminated:bool,default=false; is_stateful=true>; NodeDef: {{node _Send}}

打电话时:

tpu = tf.distribute.cluster_resolver.TPUClusterResolver()  # TPU detection
print('Running on TPU ', tpu.cluster_spec().as_dict()['worker'])
tf.config.experimental_connect_to_cluster(tpu)
tf.tpu.experimental.initialize_tpu_system(tpu)

Google Colab上没有这样的问题