From 552d28f69071602e7575e10e7bf79a90e6b578e8 Mon Sep 17 00:00:00 2001 From: Guillaume Habault Date: Fri, 26 Jul 2024 18:06:47 +0900 Subject: [PATCH] Replace torch._six.string_classes by str According to https://github.com/pytorch/pytorch/pull/97863 torch._six has been removed. I propose the following modification to avoid the error "module 'torch' has no attribute '_six'". This solution is also suggested in other projects. --- datasets/vision.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datasets/vision.py b/datasets/vision.py index 0f156c1a..d8f6ee8d 100644 --- a/datasets/vision.py +++ b/datasets/vision.py @@ -7,7 +7,7 @@ class VisionDataset(data.Dataset): _repr_indent = 4 def __init__(self, root, transforms=None, transform=None, target_transform=None): - if isinstance(root, torch._six.string_classes): + if isinstance(root, str): root = os.path.expanduser(root) self.root = root