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

Error when trying to import keras_tuner #912

Open
DManowitz opened this issue Jun 13, 2023 · 5 comments
Open

Error when trying to import keras_tuner #912

DManowitz opened this issue Jun 13, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@DManowitz
Copy link

Describe the bug
When trying to import keras_tuner, I get the following error(s):

Traceback (most recent call last):
  File "...\lib\site-packages\keras_tuner\protos\__init__.py", line 22, in <module>
    from keras_tuner.protos import v4 as protos
  File "...\lib\site-packages\keras_tuner\protos\v4\__init__.py", line 16, in <module>
    from keras_tuner.protos.v4 import keras_tuner_pb2
  File "...\lib\site-packages\keras_tuner\protos\v4\keras_tuner_pb2.py", line 19, in <module>
    from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (...\lib\site-packages\google\protobuf\internal\__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "...\lib\site-packages\keras_tuner\__init__.py", line 17, in <module>
    from keras_tuner import oracles
  File "...\lib\site-packages\keras_tuner\oracles\__init__.py", line 15, in <module>
    from keras_tuner.tuners.bayesian import BayesianOptimizationOracle
  File "...\lib\site-packages\keras_tuner\tuners\__init__.py", line 16, in <module>
    from keras_tuner.tuners.bayesian import BayesianOptimization
  File "...\lib\site-packages\keras_tuner\tuners\bayesian.py", line 31, in <module>
    from keras_tuner.engine import hyperparameters as hp_module
  File "...\lib\site-packages\keras_tuner\engine\hyperparameters\__init__.py", line 18, in <module>
    from keras_tuner.engine.hyperparameters import hp_types
  File "...\lib\site-packages\keras_tuner\engine\hyperparameters\hp_types\__init__.py", line 18, in <module>
    from keras_tuner.engine.hyperparameters.hp_types.boolean_hp import Boolean
  File "...\lib\site-packages\keras_tuner\engine\hyperparameters\hp_types\boolean_hp.py", line 15, in <module>
    from keras_tuner import protos
  File "...\lib\site-packages\keras_tuner\protos\__init__.py", line 24, in <module>
    from keras_tuner.protos import v3 as protos
  File "...\lib\site-packages\keras_tuner\protos\v3\__init__.py", line 16, in <module>
    from keras_tuner.protos.v3 import keras_tuner_pb2
  File "...\lib\site-packages\keras_tuner\protos\v3\keras_tuner_pb2.py", line 35, in <module>
    _SAMPLING = DESCRIPTOR.enum_types_by_name["Sampling"]
AttributeError: 'NoneType' object has no attribute 'enum_types_by_name'

To Reproduce
import keras_tuner

Expected behavior
No crash

Additional context

Would you like to help us fix it?
YES!

@DManowitz DManowitz added the bug Something isn't working label Jun 13, 2023
@fredopogi
Copy link

Hi! I am experiencing the same problem.
Python version is 3.9.17, Keras and TensorFlow version is 2.7.0.
I was wondering if you were able to solve this

@rjavierch
Copy link

I am currently facing the same issue. Did you manage to solve it?

@Grrammel
Copy link

Same issue there. Has anyone solved it ?

@Mores-Jr
Copy link

Same issue.

@Grrammel
Copy link

I resolved my problem. I think it was a compatibility issue between different packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants