mljar / mljar-supervised

Python package for AutoML on Tabular Data with Feature Engineering, Hyper-Parameters Tuning, Explanations and Automatic Documentation
https://mljar.com
MIT License
3k stars 401 forks source link

RuntimeError: main thread is not in main loop #98

Closed alexandrebrilhante closed 4 years ago

alexandrebrilhante commented 4 years ago

Using the README's example, a simple AutoML pipeline seems to fail and not go all the way:

Create directory AutoML_1
AutoML task to be solved: binary_classification
AutoML will use algorithms: ['Baseline', 'Linear', 'Decision Tree', 'Random Forest', 'Extra Trees', 'LightGBM', 'Xgboost', 'CatBoost']
AutoML will optimize for metric: logloss
AutoML will try to check about 74 models
There are columns ['workclass', 'occupation', 'native-country'] with missing values which didnt have missing values in train dataset.
There are columns ['workclass', 'occupation', 'native-country'] with missing values which didnt have missing values in train dataset.
There are columns ['workclass', 'occupation', 'native-country'] with missing values which didnt have missing values in train dataset.
There are columns ['workclass', 'occupation', 'native-country'] with missing values which didnt have missing values in train dataset.
There are columns ['workclass', 'occupation', 'native-country'] with missing values which didnt have missing values in train dataset.
Baseline final logloss 0.55201129653709 time 0.86 seconds
Linear final logloss 0.38316141937899484 time 29.29 seconds
Decision Tree final logloss 0.36948477937385243 time 53.41 seconds
Decision Tree final logloss 0.3482501934937481 time 75.58 seconds
Decision Tree final logloss 0.4711804610944867 time 35.29 seconds
LightGBM final logloss 0.31800370195311684 time 53.8 seconds
Exception ignored in: <function Image.__del__ at 0x00000260F0EEA948>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\tkinter\__init__.py", line 3507, in __del__
    self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <function Image.__del__ at 0x00000260F0EEA948>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\tkinter\__init__.py", line 3507, in __del__
    self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <function Image.__del__ at 0x00000260F0EEA948>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\tkinter\__init__.py", line 3507, in __del__
    self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <function Image.__del__ at 0x00000260F0EEA948>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\tkinter\__init__.py", line 3507, in __del__
    self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <function Image.__del__ at 0x00000260F0EEA948>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64\lib\tkinter\__init__.py", line 3507, in __del__
    self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Tcl_AsyncDelete: async handler deleted by the wrong thread
pplonski commented 4 years ago

@brilhana thanks for reporting! I've made a ton of new changes in the code. Can you tell me what version of mljar-supervised are you using? (How you installed it, from pip or from source?)

pplonski commented 4 years ago

BTW, in this package, I'm not using tkinter so your error looks very weird.

alexandrebrilhante commented 4 years ago

Seems to be caused by Microsoft Visual Studio's version of Python (3.7.5). Unable to reproduce this bug on Linux (Ubuntu / Centos).

pplonski commented 4 years ago

@brilhana thanks for checking!

I'm also using Visual Studio. It has a nice feature to preview markdown reports that are generated from mljar-upservised.