Skip to content

Fix cross-platform path normalization for model loading (#541)#821

Open
TheChyeahhh wants to merge 1 commit into
mljar:masterfrom
TheChyeahhh:fix/windows-linux-path-normalization
Open

Fix cross-platform path normalization for model loading (#541)#821
TheChyeahhh wants to merge 1 commit into
mljar:masterfrom
TheChyeahhh:fix/windows-linux-path-normalization

Conversation

@TheChyeahhh

Copy link
Copy Markdown

Description

When a model is trained on Windows, os.path.join stores paths with backslashes (e.g., model_1/100_LightGBM\\learner_fold_0.lightgbm). Loading the model on Linux fails because os.path.join doesn't handle the mixed separators correctly.

Fix

Normalize backslashes to forward slashes in learner_subpath before joining with results_path, enabling models trained on Windows to be loaded on Linux (and vice versa).

Related Issue

Closes #541

When a model is trained on Windows, os.path.join stores paths with
backslashes. Loading the model on Linux fails because os.path.join
doesn't handle the mixed separators correctly.

Fix: normalize backslashes to forward slashes before joining paths,
enabling models trained on Windows to be loaded on Linux and vice versa.

Closes mljar#541
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Path normalization (train on Windows and deploy on Linux)

1 participant