JustinaPetr / Weatherbot_Tutorial

275 stars 446 forks source link

Module not found tensorflow.contrib #110

Closed cesarcruzc closed 4 years ago

cesarcruzc commented 4 years ago

Hi everyone,

When I ran python train_init.py I got this error:

python train_init.py
Using TensorFlow backend.
Traceback (most recent call last):
  File "train_init.py", line 17, in <module>
    agent = Agent('weather_domain.yml', policies=[MemoizationPolicy(), KerasPolicy()])
  File "/home/cesarcruz/Documents/tutorials/rasa-weatherbot/venv/lib/python3.6/site-packages/rasa_core/policies/keras_policy.py", line 28, in __init__
    import keras
  File "/home/cesarcruz/Documents/tutorials/rasa-weatherbot/venv/lib/python3.6/site-packages/keras/__init__.py", line 4, in <module>
    from . import activations
  File "/home/cesarcruz/Documents/tutorials/rasa-weatherbot/venv/lib/python3.6/site-packages/keras/activations.py", line 6, in <module>
    from .engine import Layer
  File "/home/cesarcruz/Documents/tutorials/rasa-weatherbot/venv/lib/python3.6/site-packages/keras/engine/__init__.py", line 8, in <module>
    from .training import Model
  File "/home/cesarcruz/Documents/tutorials/rasa-weatherbot/venv/lib/python3.6/site-packages/keras/engine/training.py", line 25, in <module>
    from .. import callbacks as cbks
  File "/home/cesarcruz/Documents/tutorials/rasa-weatherbot/venv/lib/python3.6/site-packages/keras/callbacks.py", line 26, in <module>
    from tensorflow.contrib.tensorboard.plugins import projector
ModuleNotFoundError: No module named 'tensorflow.contrib'

Maybe do you have the same problem?

cesarcruzc commented 4 years ago

I have found the solution and was replace the tensorflow version to tensorflow==1.4.0 and keras to Keras==2.1.2

I have shared my requirements.txt here: https://github.com/JustinaPetr/Weatherbot_Tutorial/issues/109#issuecomment-634965431