automl / SMAC3

SMAC3: A Versatile Bayesian Optimization Package for Hyperparameter Optimization
https://automl.github.io/SMAC3/v2.1.0/
Other
1.08k stars 222 forks source link

Segfault on Archlinux (probably swig related) #545

Closed stheid closed 5 years ago

stheid commented 5 years ago

Description

running https://github.com/automl/SMAC3/blob/master/examples/fmin_rosenbrock.py results in a segfault.

I also tried running my own program first and there the error occures inside SMAC4HPO.__init__()

Steps/Code to Reproduce

  1. Install swig on archlinux via pacman
  2. Install smac via pip
  3. execute example => segfault (this is swig 4)

replace step 1 with (continue with smac install):

  1. Install swig3 on archlinux via pacman
  2. sudo ln -s /usr/bin/swig-3 /usr/bin/swig => same segfault

Expected Results

no segfault

Actual Results

/usr/bin/python3.7 /home/gamer01/Projects/Whatsapp_analysis/testsmac.py
/usr/lib/python3.7/site-packages/pyparsing.py:3168: FutureWarning: Possible set intersection at position 3
  self.re = re.compile(self.reString)
INFO:smac.utils.io.cmd_reader.CMDReader:Output to smac3-output_2019-10-13_19:35:02_943499
INFO:smac.facade.smac_hpo_facade.SMAC4HPO:Optimizing a deterministic scenario for quality without a tuner timeout - will make SMAC deterministic and only evaluate one configuration per iteration!

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

Versions

0.11.1

stheid commented 5 years ago

I tracked the segfault down to line 71 in regression.py

Changing the facade to SMAC4BO fixes the issue. Therefore its quite obvious that its related to the random forest implementation.

mlindauer commented 5 years ago

Thank you for trying to look into this issue. Unfortunately, we are not familiar with archlinux s.t. we cannot provide support for it. Furthermore, our main developer of the pyrfr package left our group quite some time ago; therefore we lack manpower to provide support for the pyrfr package in general.

If you find a way to fix the issue, we would highly appreciate a PR.

Best, Marius

stheid commented 5 years ago

I fixed the issue by reinstalling pyrfr

sudo pip uninstall pyrfr
sudo pip install pyrfr

with swig3 installed and linked to

sudo pacman -Syu swig3
sudo ln -s /usr/bin/swig-3 /usr/bin/swig

Reinstalling smac has no effect, as swig seems to be only used during the installation of pyrfr (https://github.com/automl/auto-sklearn/issues/314: > swigging pyrfr/regression.i to pyrfr/regression_wrap.cpp)

SMAC4HPO works also properly when i uninstall swig, therefore i think its only a build dependency of pyrfr

This issue also says that swig must be <=4.0: https://github.com/automl/random_forest_run/issues/51

stheid commented 5 years ago

So building/installing pyrfr with swig3 solves the issue. i will create a pullrequest for the README.md