Rasa_core.visualize generates invalid .png-file

I also got the same error , such as follow.

  • Environment:
    • ubuntu 18.04
    • python 3.6.8
    • rasa-core 0.12.4
    • rasa-core-sdk 0.12.2
    • rasa-nlu 0.13.8

My codes is as follows.

from rasa_core.agent import Agent
agent = Agent('domain.yml')
agent.visualize("./data/stories.md", "test1.png", max_history=2)
Image(filename="test1.png")

Out[1]:

/home/iot/miniconda3/envs/py36/lib/python3.6/site-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, 892.63it/s, # trackers=1]


Now, I have found the solution. Just change the file *.png to *.html. The details refer to Unable to visualize the training data. @rein @diane