sb-ai-lab / LightAutoML

Fast and customizable framework for automatic ML model creation (AutoML)
https://developers.sber.ru/portal/products/lightautoml
Apache License 2.0
1.18k stars 51 forks source link

TypeError: cannot set 'get_record_history_wrapper' attribute of immutable type 'object' #87

Closed Hoigr closed 1 year ago

Hoigr commented 1 year ago

In google colab when trying to execute the following code: !pip install lightautoml

from lightautoml.automl.presets.tabular_presets import TabularAutoML from lightautoml.tasks import Task

The following error is displayed:


TypeError Traceback (most recent call last) in <cell line: 1>() ----> 1 from lightautoml.automl.presets.tabular_presets import TabularAutoML 2 from lightautoml.tasks import Task

10 frames /usr/local/lib/python3.10/dist-packages/lightautoml/init.py in 14 version = importlib_metadata.version(name) 15 ---> 16 from .addons import 17 from .addons.utilization import 18 from .automl import *

/usr/local/lib/python3.10/dist-packages/lightautoml/addons/utilization/init.py in 1 """Tools to configure resources utilization.""" ----> 2 from .utilization import TimeUtilization 3 4 all = ['TimeUtilization']

/usr/local/lib/python3.10/dist-packages/lightautoml/addons/utilization/utilization.py in 6 from log_calls import record_history 7 ----> 8 from ...automl.base import AutoML 9 from ...automl.blend import Blender, BestModelSelector 10 from ...automl.presets.base import AutoMLPreset

/usr/local/lib/python3.10/dist-packages/lightautoml/automl/base.py in 6 from log_calls import record_history 7 ----> 8 from .blend import Blender, BestModelSelector 9 from ..dataset.base import LAMLDataset 10 from ..dataset.utils import concatenate

/usr/local/lib/python3.10/dist-packages/lightautoml/automl/blend.py in 7 from scipy.optimize import minimize_scalar 8 ----> 9 from ..dataset.base import LAMLDataset 10 from ..dataset.np_pd_dataset import NumpyDataset 11 from ..dataset.roles import NumericRole

/usr/local/lib/python3.10/dist-packages/lightautoml/dataset/base.py in 6 from log_calls import record_history 7 ----> 8 from .roles import ColumnRole 9 from ..tasks.base import Task 10

/usr/local/lib/python3.10/dist-packages/lightautoml/dataset/roles.py in 13 14 @record_history(enabled=False) ---> 15 class ColumnRole: 16 """Abstract class for column role. 17

/usr/local/lib/python3.10/dist-packages/log_calls/log_calls.py in call(self, f_or_klass) 1689 #++++++++++++++++++++++++++++++++ 1690 -> 1691 self._classcall(klass) # modifies klass (methods & inner classes) (if not builtin) 1692 self._add_class_attrs(klass) # v0.3.0v20 traps TypeError for builtins 1693 return klass

/usr/local/lib/python3.10/dist-packages/log_calls/log_calls.py in _classcall(self, klass) 1480 new_omit += deco_obj._omit 1481 -> 1482 new_class = self.class( 1483 settings=new_settings, 1484 only=new_only,

/usr/local/lib/python3.10/dist-packages/log_calls/log_calls.py in call(self, f_or_klass) 1690 1691 self._classcall(klass) # modifies klass (methods & inner classes) (if not builtin) -> 1692 self._add_class_attrs(klass) # v0.3.0v20 traps TypeError for builtins 1693 return klass 1694

/usr/local/lib/python3.10/dist-packages/log_calls/log_calls.py in _add_class_attrs(self, klass) 2136 this_deco_class = self.class 2137 this_deco_class_name = this_decoclass.name -> 2138 setattr( 2139 klass, 2140 'get' + this_deco_class_name + '_wrapper',

TypeError: cannot set 'get_record_history_wrapper' attribute of immutable type 'object'

alexmryzhkov commented 1 year ago

Hi @Hoigr,

This is the known problem because currently LightAutoML doesn’t support python 3.10. You can use it from our github repo if you need 3.10, but I recommend to replace python with 3.9 version.

Alex