autogluon / autogluon

Fast and Accurate ML in 3 Lines of Code
https://auto.gluon.ai/
Apache License 2.0
7.67k stars 902 forks source link

[BUG]image classification doesn't work #3856

Closed rxjx closed 8 months ago

rxjx commented 8 months ago

Ubuntu 20.04 autogluon 1.0.0

My original train_df had column labels 'img' and 'lbl'. This code failed:

from autogluon.multimodal import MultiModalPredictor

predictor = MultiModalPredictor(label='lbl', problem_type='multiclass', presets='medium_quality', path='models/mq')
predictor.fit(train_data=train_df, presets='medium_quality', column_types={'img':'image_path'})

That code resulted in the first 3 checkpoints getting saved and no improvement thereafter, no matter which backbone or preset I used. At inference time, predict_proba assigned equal probs to all classes for each row. Note that I had to specify column type else the text predictor would get used since the img column is detected as text instead of filepaths.

Tested that the Quick Start shopee example does work. Initially I thought changing the column names helped but turns out that was just reverting to a text predictor because I hadn't specified the column type.

rxjx commented 8 months ago

Ah crap! This is user error. Sorry.