abhishekkrthakur / autoxgb

XGBoost + Optuna
Apache License 2.0
653 stars 90 forks source link

AssertionError - assert version is not None #27

Open ekamioka opened 1 year ago

ekamioka commented 1 year ago

executed code:

>>> axgb = AutoXGB(
...     train_filename="X_train.csv",
...     output="output",
...     test_filename="X_valid.csv",
...     task="classification",
...     idx=None,
...     targets=["label"],
...     features=['feat1', 'feat2', 'feat3', 'feat4', 'feat5'],
...     categorical_features=None,
...     use_gpu=False,
...     num_folds=5,
...     seed=42,
...     num_trials=100,
...     time_limit=360,
...     fast=False,
... )

error log:

2023-04-21 04:37:30.385 | INFO     | autoxgb.autoxgb:_process_data:149 - Reading training data
2023-04-21 04:37:30.727 | INFO     | autoxgb.utils:reduce_memory_usage:48 - Mem. usage decreased to 5.07 Mb (80.9% reduction)
2023-04-21 04:37:30.732 | INFO     | autoxgb.autoxgb:_determine_problem_type:140 - Problem type: multi_class_classification
2023-04-21 04:37:30.851 | INFO     | autoxgb.utils:reduce_memory_usage:48 - Mem. usage decreased to 1.87 Mb (82.4% reduction)
2023-04-21 04:37:30.851 | INFO     | autoxgb.autoxgb:_create_folds:58 - Creating folds
2023-04-21 04:37:30.868 | INFO     | autoxgb.autoxgb:_process_data:170 - Encoding target(s)
2023-04-21 04:37:30.875 | INFO     | autoxgb.autoxgb:_process_data:195 - Found 0 categorical features.
2023-04-21 04:37:31.084 | INFO     | autoxgb.autoxgb:_process_data:236 - Model config: train_filename='X_train.csv' test_filename='X_valid.csv' idx='id' targets=['label'] problem_type=<ProblemType.multi_class_classification: 2> output='output' features=['feat1', 'feat2', 'feat3', 'feat4', 'feat5'] num_folds=5 use_gpu=False seed=42 categorical_features=[] num_trials=100 time_limit=360 fast=False
2023-04-21 04:37:31.084 | INFO     | autoxgb.autoxgb:_process_data:237 - Saving model config
2023-04-21 04:37:31.085 | INFO     | autoxgb.autoxgb:_process_data:241 - Saving encoders

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/workspace/models/venv-autoxgb/lib/python3.8/site-packages/autoxgb/autoxgb.py", line 247, in train
    best_params = train_model(self.model_config)
  File "/workspace/models/venv-autoxgb/lib/python3.8/site-packages/autoxgb/utils.py", line 207, in train_model
    study = optuna.create_study(
  File "/workspace/models/venv-autoxgb/lib/python3.8/site-packages/optuna/study/study.py", line 1136, in create_study
    storage = storages.get_storage(storage)
  File "/workspace/models/venv-autoxgb/lib/python3.8/site-packages/optuna/storages/__init__.py", line 31, in get_storage
    return _CachedStorage(RDBStorage(storage))
  File "/workspace/models/venv-autoxgb/lib/python3.8/site-packages/optuna/storages/_rdb/storage.py", line 187, in __init__
    self._version_manager.check_table_schema_compatibility()
  File "/workspace/models/venv-autoxgb/lib/python3.8/site-packages/optuna/storages/_rdb/storage.py", line 1310, in check_table_schema_compatibility
    current_version = self.get_current_version()
  File "/workspace/models/venv-autoxgb/lib/python3.8/site-packages/optuna/storages/_rdb/storage.py", line 1337, in get_current_version
    assert version is not None
AssertionError

pip freeze:

alembic==1.10.3
anyio==3.6.2
asgiref==3.6.0
attrs==23.1.0
autopage==0.5.1
autoxgb==0.2.2
click==8.1.3
cliff==4.2.0
cmaes==0.9.1
cmd2==2.4.3
colorlog==6.7.0
fastapi==0.70.0
greenlet==2.0.2
h11==0.14.0
idna==3.4
importlib-metadata==6.5.0
importlib-resources==5.12.0
joblib==1.1.0
loguru==0.5.3
Mako==1.2.4
MarkupSafe==2.1.2
numpy==1.21.3
optuna==2.10.0
packaging==23.1
pandas==1.3.4
pbr==5.11.1
prettytable==3.7.0
pyarrow==6.0.0
pydantic==1.8.2
pyperclip==1.8.2
python-dateutil==2.8.2
pytz==2023.3
PyYAML==6.0
scikit-learn==1.0.1
scipy==1.10.1
six==1.16.0
sniffio==1.3.0
SQLAlchemy==2.0.9
starlette==0.16.0
stevedore==5.0.0
threadpoolctl==3.1.0
tqdm==4.65.0
typing_extensions==4.5.0
uvicorn==0.15.0
wcwidth==0.2.6
xgboost==1.5.0
zipp==3.15.0
songyang1997 commented 1 year ago

This is because the version of your sqlalchemy library is too high and needs to be downgraded to sqlalchemy=1.4.45 to solve the problem