def tpu_load(self, save_file):
if "gs://" in save_file:
if not tf.io.gfile.exists(save_file):
return False
temp_name = next(tempfile._get_candidate_names())
temp_dir = tempfile._get_default_tempdir()
temp_dir = temp_dir+"/"+temp_name
tf.io.gfile.mkdir(temp_dir)
After Change
if not tf.io.gfile.exists(save_file) and not tf.io.gfile.exists(save_file + ".index" ):
return False
if "gs://" in save_file:
save_dir = "/".join(save_file.split("/")[0:-1])
temp_name = next(tempfile._get_candidate_names())
temp_dir = tempfile._get_default_tempdir()
temp_dir = temp_dir+"/"+temp_name
tf.io.gfile.mkdir(temp_dir)