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.12k stars 52 forks source link

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

Closed senovr closed 2 years ago

senovr commented 2 years ago

Hi, I am trying to set up lama in python 3.10 System is Windows 10, I created a separate .venv for this.

when I am trying to execute: from lightautoml.automl.presets.tabular_presets import TabularAutoML, TabularUtilizedAutoML it fails with the following traceback:

---> [13](vscode-notebook-cell:/c%3A/Users/Sergey/repos/air-quality/Copy_of_starter.ipynb#ch0000064?line=12) from lightautoml.automl.presets.tabular_presets import TabularAutoML, TabularUtilizedAutoML
     [14](vscode-notebook-cell:/c%3A/Users/Sergey/repos/air-quality/Copy_of_starter.ipynb#ch0000064?line=13) from lightautoml.tasks import Task
     [15](vscode-notebook-cell:/c%3A/Users/Sergey/repos/air-quality/Copy_of_starter.ipynb#ch0000064?line=14) from lightautoml.report.report_deco import ReportDeco

File c:\Users\Sergey\repos\air-quality\.venv\lib\site-packages\lightautoml\__init__.py:16, in <module>
     12     import importlib_metadata
     14 __version__ = importlib_metadata.version(__name__)
---> 16 from .addons import *
     17 from .addons.utilization import *
     18 from .automl import *

File c:\Users\Sergey\repos\air-quality\.venv\lib\site-packages\lightautoml\addons\utilization\__init__.py:2, in <module>
      1 """Tools to configure resources utilization."""
----> 2 from .utilization import TimeUtilization
      4 __all__ = ['TimeUtilization']

File c:\Users\Sergey\repos\air-quality\.venv\lib\site-packages\lightautoml\addons\utilization\utilization.py:8, in <module>
      4 from typing import Optional, Any, Sequence, Type, Union, Iterable
      6 from log_calls import record_history
----> 8 from ...automl.base import AutoML
...
   2145 # or `get_own_record_history_wrapper(fname)`
   2146 # This can be called on a deco'd class or on an instance thereof.
   2147 this_deco_class = self.__class__

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

Any hints / suggestions on that error?

alexmryzhkov commented 2 years ago

Hi @senovr,

As I can see from the last lines of your traceback, you still have log_calls library which was removed from the code several versions ago. If you are using the version built from the source code, please update it to the current master head; if from pypi - please install once again with -U flag

Alex

senovr commented 2 years ago

hi Alex,

It seems that the issue is python 3.10. Whein I am doing pip install -U lightautoml - version does not change. Whein I am doing pip install -u git+"path_to_lama_git" - it fails with a traceback indicating that no torch is available for 3.10 yet. So, I have to wait untill torch version for 3.10 will become available ( there is an active issue on torch github for that) https://github.com/pytorch/pytorch/issues/66424

For now , I fixed the issue by rolling back .venv to 3.9.