question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot import name 'conditional' from 'hyperas.distributions'

See original GitHub issue

i use other people’s code:

from __future__ import print_function

from hyperopt import Trials, STATUS_OK, tpe
from keras.datasets import mnist
from keras.layers.core import Dense, Dropout, Activation
from keras.models import Sequential
from keras.utils import np_utils

from hyperas import optim
from hyperas.distributions import choice, uniform, conditional

and error occured:

Traceback (most recent call last):

  File "<ipython-input-1-77a51f029857>", line 10, in <module>
    from hyperas.distributions import choice, uniform, conditional

ImportError: cannot import name 'conditional' from 'hyperas.distributions' (C:\Users\peter\Anaconda3\lib\site-packages\hyperas\distributions.py)

i tryed:

pip uninstall hyperas
pip install git+https://github.com/maxpumperla/hyperas.git
pip uninstall hyperopt
pip install git+https://github.com/hyperopt/hyperopt.git

but the problem is still there.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
maxpumperlacommented, Apr 12, 2019

conditional is definitely gone from master and the last release (if I remember correctly). You can get rid of the error by removing all the conditional calls from “other people’s code”. 😄

0reactions
cklatcommented, Jul 19, 2019

is there any solution/alternative for conditional? I have basically the same code snippet that @ljakupi has posted for optimizing the number of layers of the trained network. However, since conditional was dropped, I’m wondering how to realize this pipeline (i.e. optimizing for number of layers)

Read more comments on GitHub >

github_iconTop Results From Across the Web

报错解决:cannot import name 'conditional' from 'hyperas ...
早上在使用hyperas时报错如下:In[5]: from hyperas.distributions import conditionalTraceback (most recent call last): File ...
Read more >
Invalid agrument error using hyperas in keras - Stack Overflow
the name of my notebook is keras_glioma_hyperopt. Still running into errors but it could be in my set up with my code.
Read more >
Hyperas by maxpumperla
Hyperas lets you use the power of hyperopt without having to learn the syntax of it. ... from hyperas.distributions import uniform model =...
Read more >
A guide to an efficient way to build neural network architectures
A guide to an efficient way to build neural network architectures- Part I: Hyper-parameter selection and tuning for Dense Networks using Hyperas on...
Read more >
Keras + Hyperopt: Convenient Hyperparameter Optimization
from hyperas.distributions import uniform def create_model(x_train, y_train, ... That fails simply because python cannot run the templating in the braces, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found