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

module 'hyperopt.pyll' has no attribute 'base' #291

Open
julesangebault opened this issue Aug 19, 2022 · 1 comment
Open

module 'hyperopt.pyll' has no attribute 'base' #291

julesangebault opened this issue Aug 19, 2022 · 1 comment

Comments

@julesangebault
Copy link

julesangebault commented Aug 19, 2022

Hi I'm trying to us Hyperas to optimise my Neural Network but I keep receiving this error message:
module 'hyperopt.pyll' has no attribute 'base'

It comes from that function:

def memo_from_config(self, config):
        memo = {}
        for node in pyll.dfs(self.expr):
            if node.name == "hyperopt_param":
                label = node.arg["label"].obj
                # -- hack because it's not really garbagecollected
                #    this does have the desired effect of crashing the
                #    function if rec_eval actually needs a value that
                #    the the optimization algorithm thought to be unnecessary
                memo[node] = config.get(label, pyll.base.GarbageCollected)
        return memo

Someone has an idea how I can fix it ?
my script where I used Hyperas:
https://gist.github.com/julesangebault/264359cc037dfe3ceee2d8b36b042869

@rottentomato13
Copy link

rottentomato13 commented Oct 6, 2022

Hey I had the same issue with you after I downgraded hyperopt to v0.2.5 to avoid the error 'numpy.random.mtrand.RandomState' object has no attribute 'integers' #284. Then I solved it by changing the row 139 of optim.py in hyperas from:
rstate=np.random.RandomState(rseed)
to
rstate=np.random.default_rng(rseed)
with hyperopt==0.2.7

Hope it will work for you!

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