if not isinstance(file_pattern, str):
raise TypeError("file_pattern must be str, but got %s"%type(file_pattern))
self._dataset = dataset
file_pattern = os.path.expanduser(file_pattern)self._files = sorted(glob.glob(file_pattern))
if len(self._files) == 0:
raise ValueError("Cannot find any file with path "%s""%file_pattern)
self._file_sampler = self._get_sampler(file_sampler)
self._kwargs = kwargs
After Change
if not isinstance(file_pattern, str):
raise TypeError("file_pattern must be str, but got %s"%type(file_pattern))
self._dataset = dataset
self._files = []
for pattern in file_pattern.split(","):
self._files.extend(glob.glob(os.path.expanduser(pattern.strip())))
self._files = sorted(self._files)
if len(self._files) == 0:
raise ValueError("Cannot find any file with path "%s""%file_pattern)
self._file_sampler = self._get_sampler(file_sampler)