Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support scipy 1.3+ #106

Open
hotohoto opened this issue Apr 19, 2021 · 1 comment
Open

Support scipy 1.3+ #106

hotohoto opened this issue Apr 19, 2021 · 1 comment

Comments

@hotohoto
Copy link

hotohoto commented Apr 19, 2021

I got this traceback using scipy 1.4.2.

Traceback (most recent call last):
...
    ray_search_algorithm=TuneBOHB(metric="loss", mode="min", seed=self.seed),
  File "/home/hotohoto/.pyenv/versions/3.6.10/envs/mlcore/lib/python3.6/site-packages/ray/tune/suggest/bohb.py", line 116, in __init__
    from hpbandster.optimizers.config_generators.bohb import BOHB
  File "/home/hotohoto/.pyenv/versions/3.6.10/envs/mlcore/lib/python3.6/site-packages/hpbandster/optimizers/__init__.py", line 3, in <module>
    from hpbandster.optimizers.bohb import BOHB
  File "/home/hotohoto/.pyenv/versions/3.6.10/envs/mlcore/lib/python3.6/site-packages/hpbandster/optimizers/bohb.py", line 14, in <module>
    from hpbandster.optimizers.config_generators.bohb import BOHB as CG_BOHB
  File "/home/hotohoto/.pyenv/versions/3.6.10/envs/mlcore/lib/python3.6/site-packages/hpbandster/optimizers/config_generators/bohb.py", line 12, in <module>
    import statsmodels.api as sm
  File "/home/hotohoto/.pyenv/versions/3.6.10/envs/mlcore/lib/python3.6/site-packages/statsmodels/api.py", line 16, in <module>
    from .discrete.discrete_model import (Poisson, Logit, Probit,
  File "/home/hotohoto/.pyenv/versions/3.6.10/envs/mlcore/lib/python3.6/site-packages/statsmodels/discrete/discrete_model.py", line 45, in <module>
    from statsmodels.distributions import genpoisson_p
  File "/home/hotohoto/.pyenv/versions/3.6.10/envs/mlcore/lib/python3.6/site-packages/statsmodels/distributions/__init__.py", line 2, in <module>
    from .edgeworth import ExpandedNormal
  File "/home/hotohoto/.pyenv/versions/3.6.10/envs/mlcore/lib/python3.6/site-packages/statsmodels/distributions/edgeworth.py", line 7, in <module>
    from scipy.misc import factorial
ImportError: cannot import name 'factorial'

Fortunately, there is a workaround.

import scipy

# patch scipy
scipy.misc.factorial = scipy.special.factorial
scipy.misc.logsumexp = scipy.special.logsumexp
scipy.misc.comb = scipy.special.comb
@hotohoto hotohoto changed the title Support python 3.6 Support scipy 1.3+ Apr 19, 2021
@mostafa-mahmoud
Copy link

@hotohoto Try updating statsmodels package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants