1

I'm using Autogluon package to train some models and then make predictions. The file structure in my project looks like this:

enter image description here

There is a folder called "Models" where I'm storing models for different chemical analytes. In each analyte's folder there is a learner.pkl, predictor.pkl, and a folder called "models" with trained models and trainer.pkl

Everything works fine until I call predict() method on TabularPredictor.


model_savepath = "Models/ascorbic acid-model"
model = TabularPredictor.load(model_savepath, require_version_match=False, verbosity=4)

to_predict = data_to_train.iloc[[0]].drop("Final", axis=1)
model.predict(to_predict)

Then I'm getting the following error:


FileNotFoundError: [Errno 2] No such file or directory: 'Models/ascorbic acid-model/models//WeightedEnsemble_L2model.pkl'

For some reason the file name is mixed with the folder name. It says it tries to load weightedensemble_L2model.pkl instead of weighedensemble_L2/model.pkl.

Why is that?

I tried changing the path or training model on linux instead of windows, nothing worked so far.

OlaG
  • 21
  • 1
  • Within "Models/ascorbic acid-model/", have you altered the default folder structure that AutoGluon creates? Seems like it could be a bug. You might consider submitting a Bug Report here: https://github.com/autogluon/autogluon/issues/new?assignees=&labels=bug%3A+unconfirmed%2CNeeds+Triage&projects=&template=bug_report.md&title=%5BBUG%5D Similar to: https://github.com/autogluon/autogluon/issues/2452 – DangerousDave Aug 22 '23 at 17:26

0 Answers0