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

TypeError: 'generator' object is not subscriptable #100

Closed
nguyenhoamy1602 opened this issue May 8, 2018 · 1 comment
Closed

TypeError: 'generator' object is not subscriptable #100

nguyenhoamy1602 opened this issue May 8, 2018 · 1 comment

Comments

@nguyenhoamy1602
Copy link

When running Iris Example and MNIST Example. The following error is seen:

Traceback (most recent call last):
  File "1.py", line 31, in <module>
    estim.fit( X_train, y_train )
  File "/Users/nguyen.hoamy/PycharmProjects/ML/hyperopt-sklearn/hpsklearn/estimator.py", line 747, in fit
    fit_iter.send(increment)
  File "/Users/nguyen.hoamy/PycharmProjects/ML/hyperopt-sklearn/hpsklearn/estimator.py", line 657, in fit_iter
    return_argmin=False, # -- in case no success so far
  File "/Users/nguyen.hoamy/PycharmProjects/ML/venv/lib/python3.6/site-packages/hyperopt/fmin.py", line 307, in fmin
    return_argmin=return_argmin,
  File "/Users/nguyen.hoamy/PycharmProjects/ML/venv/lib/python3.6/site-packages/hyperopt/base.py", line 635, in fmin
    return_argmin=return_argmin)
  File "/Users/nguyen.hoamy/PycharmProjects/ML/venv/lib/python3.6/site-packages/hyperopt/fmin.py", line 314, in fmin
    pass_expr_memo_ctrl=pass_expr_memo_ctrl)
  File "/Users/nguyen.hoamy/PycharmProjects/ML/venv/lib/python3.6/site-packages/hyperopt/base.py", line 786, in __init__
    pyll.toposort(self.expr)
  File "/Users/nguyen.hoamy/PycharmProjects/ML/venv/lib/python3.6/site-packages/hyperopt/pyll/base.py", line 715, in toposort
    assert order[-1] == expr
TypeError: 'generator' object is not subscriptable
@bjkomer
Copy link
Member

bjkomer commented May 8, 2018

This is due to an older version of hyperopt not working with the latest networkx.

You can either upgrade to the latest master of hyperopt using pip install --upgrade git+git://github.com/hyperopt/hyperopt.git
or downgrade the networkx dependency using pip install networkx==1.11

Duplicate of #90 and hyperopt issue 325

@bjkomer bjkomer closed this as completed May 8, 2018
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