diff --git a/mmengine/fileio/file_client.py b/mmengine/fileio/file_client.py index 056b814a71..a371a1864e 100644 --- a/mmengine/fileio/file_client.py +++ b/mmengine/fileio/file_client.py @@ -87,7 +87,7 @@ def _map_path(self, filepath: Union[str, Path]) -> str: filepath = str(filepath) if self.path_mapping is not None: for k, v in self.path_mapping.items(): - filepath = filepath.replace(k, v) + filepath = filepath.replace(k, v, 1) return filepath def _format_path(self, filepath: str) -> str: