ImportError: cannot import name 'read_yaml'

This error is obtained when running this command. Please help. Thanks in advance. Version: rasa = 1.2.3, ruamel.yaml = 0.15.89, hyperopt = 0.1.1 @Tobias_Wochinger

(venv) chunjie97@Dino:~/nlu-hyperopt-master$ python -m nlu_hyperopt.app
INFO:__main__:Starting up
Running experiment : default
Max evaluations: 100
Search space: {'epochs': <hyperopt.pyll.base.Apply object at 0x7f50b157fa90>, 'max_df': <hyperopt.pyll.base.Apply object at 0x7f50b150b2b0>, 'max_ngrams': <hyperopt.pyll.base.Apply object at 0x7f50b150b438>}
INFO:hyperopt.tpe:tpe_transform took 0.000781 seconds
INFO:hyperopt.tpe:TPE using 0 trials
INFO:hyperopt.fmin:job exception: cannot import name 'read_yaml'
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/chunjie97/nlu-hyperopt-master/nlu_hyperopt/app.py", line 49, in <module>
    max_evals=max_evals)
  File "/home/chunjie97/venv/lib/python3.6/site-packages/hyperopt/fmin.py", line 385, in fmin
    rval.exhaust()
  File "/home/chunjie97/venv/lib/python3.6/site-packages/hyperopt/fmin.py", line 244, in exhaust
    self.run(self.max_evals - n_done, block_until_done=self.asynchronous)
  File "/home/chunjie97/venv/lib/python3.6/site-packages/hyperopt/fmin.py", line 218, in run
    self.serial_evaluate()
  File "/home/chunjie97/venv/lib/python3.6/site-packages/hyperopt/fmin.py", line 137, in serial_evaluate
    result = self.domain.evaluate(spec, ctrl)
  File "/home/chunjie97/venv/lib/python3.6/site-packages/hyperopt/base.py", line 840, in evaluate
    rval = self.fn(pyll_rval)
  File "/home/chunjie97/nlu-hyperopt-master/nlu_hyperopt/app.py", line 18, in worker_function
    from nlu_hyperopt.optimization import run_trial
  File "/home/chunjie97/nlu-hyperopt-master/nlu_hyperopt/optimization.py", line 4, in <module>
    from rasa.nlu.utils import read_yaml
ImportError: cannot import name 'read_yaml'

Hey @chunjie97, unfortunately, the nlu-hyperopt is a bit outdated. You’ll have to make a few small changes to make it work with your version of Rasa, but don’t worry, it’s nothing scary. As for the particular error you’re getting, I think you need to change the import statement in optimization.py to this: from rasa.utils.io import read_yaml. Let me know how it goes.