Starter-pack-rasa-stack cannot run 'make train-core', Keras error no module 'Activation'

I follow the README.md on Github starter-pack-rasa-stack, and all the previous steps are succeeded, but when I run ‘make train-core’, I encounter error.

I am running on Paperspace.com, starting with a Paperspace machine with pre-installed Tensorflow 1.5.0 Python Notebook, Python version is 3.5.2. I know Tensorflow 1.5.0 is old but I upgraded the tensorflow already.

Here is the short summary of what I done on the Python Notebook of the Paperspace machine, the output of all the following are very nice looking:

  • download starter-pack-rasa-stack.zip and unzip to subfolder name ‘storage’ (Paperspace persistence storage)
  • !pip install --upgrade tensorflow-gpu
  • !pip install keras --upgrade
  • !pip install rasa_core
  • !pip install rasa_nlu[tensorflow]
  • !cd storage/starter-pack-rasa-stack-master; pip install -r requirements.txt
  • !python -m spacy download en
  • !cd storage/starter-pack-rasa-stack-master; make train-nlu

After upgrade, tensorflow version as reported with this command

  • import tensorflow as tf; print(tf.version)
  • is 1.12.0, and requirement.txt inside /starter-pack-rasa-stack is tensorflow==1.10.0

Here is the command end up with error:

!cd storage/starter-pack-rasa-stack-master; make train-core

Here is the error:

/usr/local/lib/python3.5/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
/usr/local/lib/python3.5/dist-packages/pykwalify/core.py:99: UnsafeLoaderWarning: 
The default 'Loader' for 'load(stream)' without further arguments can be unsafe.
Use 'load(stream, Loader=ruamel.yaml.Loader)' explicitly if that is OK.
Alternatively include the following in your code:

  import warnings
  warnings.simplefilter('ignore', ruamel.yaml.error.UnsafeLoaderWarning)

In most other cases you should consider using 'safe_load(stream)'
  data = yaml.load(stream)
Processed Story Blocks: 100%|#####| 6/6 [00:00<00:00, 4145.25it/s, # trackers=1]
Processed Story Blocks: 100%|#####| 6/6 [00:00<00:00, 1122.42it/s, # trackers=6]
Processed Story Blocks: 100%|#####| 6/6 [00:00<00:00, 186.70it/s, # trackers=36]
Processed Story Blocks: 100%|#####| 6/6 [00:00<00:00, 167.69it/s, # trackers=31]
2018-12-31 17:07:16.166293: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2018-12-31 17:07:16.569391: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:964] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-12-31 17:07:16.569717: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties: 
name: Quadro M4000 major: 5 minor: 2 memoryClockRate(GHz): 0.7725
pciBusID: 0000:00:05.0
totalMemory: 7.94GiB freeMemory: 7.87GiB
2018-12-31 17:07:16.569754: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0
2018-12-31 17:07:16.900710: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-12-31 17:07:16.900773: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988]      0 
2018-12-31 17:07:16.900782: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0:   N 
2018-12-31 17:07:16.901006: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 7592 MB memory) -> physical GPU (device: 0, name: Quadro M4000, pci bus id: 0000:00:05.0, compute capability: 5.2)
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.5/dist-packages/rasa_core/train.py", line 358, in <module>
    additional_args)
  File "/usr/local/lib/python3.5/dist-packages/rasa_core/train.py", line 273, in do_default_training
    kwargs=additional_arguments)
  File "/usr/local/lib/python3.5/dist-packages/rasa_core/train.py", line 197, in train_dialogue_model
    agent.train(training_data, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/rasa_core/agent.py", line 536, in train
    **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/rasa_core/policies/ensemble.py", line 67, in train
    policy.train(training_trackers, domain, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/rasa_core/policies/keras_policy.py", line 165, in train
    shuffled_y.shape[1:])
  File "/usr/local/lib/python3.5/dist-packages/rasa_core/policies/keras_policy.py", line 99, in model_architecture
    from tensorflow.keras.models import Sequential
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/keras/__init__.py", line 20, in <module>
    from tensorflow.keras import layers
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/keras/layers/__init__.py", line 9, in <module>
    from tensorflow.python.keras.applications.densenet import Activation
ImportError: cannot import name 'Activation'
Makefile:31: recipe for target 'train-core' failed
make: *** [train-core] Error 1

Hi,

I had resolved the problem redo everything in another (Win10) platform using Anaconda, Python3, tensorflow 1.10, and some tweaks.

By the way there is some path character problems with rasa_core when start cmdline, anyway should be trival \ vs / differences between linux vs windows, I will go in the code synonymsxxx.py to fit it.

Thanks

I suggest using virtualenv to contain your setups in the future. Will allow you to create a clean environment at need :slight_smile: