diff --git a/psyneulink/library/compositions/autodiffcomposition.py b/psyneulink/library/compositions/autodiffcomposition.py index 9dd3ec61d9f..1dfbdce4a33 100644 --- a/psyneulink/library/compositions/autodiffcomposition.py +++ b/psyneulink/library/compositions/autodiffcomposition.py @@ -612,9 +612,10 @@ def save(self, path:PosixPath=None, directory:str=None, filename:str=None, conte else: path = Path(os.getcwd()) if filename: - path = Path(path / filename) + # path = Path(path / filename) + path = Path(os.path.join(path / filename)) else: - path = Path(path / f'{self.name}_matrix_wts.pnl') + path = Path(os.path.join(path / f'{self.name}_matrix_wts.pnl')) except IsADirectoryError: raise AutodiffCompositionError(f"'{path}' (for saving weight matrices of ({self.name}) " f"is not a legal path.") @@ -675,9 +676,11 @@ def load(self, path:PosixPath=None, directory:str=None, filename:str=None, conte else: path = Path(os.getcwd()) if filename: - path = Path(path / filename) + # path = Path(path / filename) + path = Path(os.path.join(path / filename)) else: - path = Path(path / f'{self.name}_matrix_wts.pnl') + # path = Path(path / f'{self.name}_matrix_wts.pnl') + path = Path(os.path.join(path , f'{self.name}_matrix_wts.pnl')) except IsADirectoryError: raise AutodiffCompositionError(f"'{path}' (for saving weight matrices of ({self.name}) " f"is not a legal path.")