Skip to content

How to reuse a model saved on a different server? #30

@minion057

Description

@minion057

I am using an Ubuntu-based server environment. Let's assume there are two servers: Server A and Server B.

On Server A, I trained models using XGB_HPO_TPE_Classifier and RealMLP_HPO_Classifier, then saved them (as .pkl files, following the instructions in another issue). At that time, the tmp directory was set as an absolute path on Server A. I then moved all the saved outputs to Server B.

On Server B, loading the model itself works fine. However, when I try to run functions like predict or predict_proba, the code tries to access the old tmp path from Server A, which leads to errors.

I also tried updating the tmp_folder path inside the loaded object, and even implemented a workaround to replace paths from Server A with Server B. This made the functions executable, but the internal objects still could not be found. As a result, the predictions look like they come from an uninitialized model (e.g., binary classification results always return around 50/50 probabilities).

From my observation, it seems that different parts of the model internally keep references to the Server A paths (inside tmp) when saving. This prevents the fully saved objects from being used properly on Server B.

My question: Is there a recommended way to update or reset all tmp paths at once when loading the model, so that I can reuse the model correctly on a different server?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions