Kaggle TPU切换至tf 2.3.1。 但是我需要tf 2.2.0。
我尝试过:
!pip install tensorflow~=2.2.0
Tensorflow切换至2.2.1。但是我遇到一个错误:
InvalidArgumentError:NodeDef预期输入“字符串”与0不匹配 指定的输入;运; attr = T:type; attr = tensor_name:字符串; attr = send_device:string; attr = send_device_incarnation:int; attr = recv_device:string; attr = client_terminated:布尔,默认= 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上没有这样的问题。