Remove deprecated call to tf.io.gfile.get_filesystem (#89832)

Fixes #30966 . Fixes #47139
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89832
Approved by: https://github.com/soumith
This commit is contained in:
Yuxin Wu
2022-12-08 08:53:24 +00:00
committed by PyTorch MergeBot
parent ecd784667c
commit c00b135adf
2 changed files with 28 additions and 15 deletions

View File

@ -923,7 +923,7 @@ class SummaryWriter(object):
subdir = "%s/%s" % (str(global_step).zfill(5), self._encode(tag))
save_path = os.path.join(self._get_file_writer().get_logdir(), subdir)
fs = tf.io.gfile.get_filesystem(save_path)
fs = tf.io.gfile
if fs.exists(save_path):
if fs.isdir(save_path):
print(
@ -959,7 +959,7 @@ class SummaryWriter(object):
if not hasattr(self, "_projector_config"):
self._projector_config = ProjectorConfig()
embedding_info = get_embedding_info(
metadata, label_img, fs, subdir, global_step, tag
metadata, label_img, subdir, global_step, tag
)
self._projector_config.embeddings.extend([embedding_info])