Rasa_core.visualize generates invalid .png-file

Hi

If I run

.\venv\Scripts\python -m rasa_core.visualize -d ./domain.yml -s ./stories_training_data/bank.md -o graph.png --debug

a graph.png is created, but I can’t open it, error-message

this is not a valid bitmap file

OS: Windows

graphviz: 2.38_x64

pygraphviz: 1.5

Debug-messages:

2019-02-22 12:24:12 INFO main - Starting to visualize stories…

2019-02-22 12:24:12 DEBUG rasa_core.training.generator - Number of augmentation rounds is 0

2019-02-22 12:24:12 DEBUG rasa_core.training.generator - Starting data generation round 0 … (with 1 trackers)

Processed Story Blocks: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1989.39it/s, # trackers=1] 2019-02-22 12:24:12 DEBUG rasa_core.training.generator - Finished phase (3 training samples found).

2019-02-22 12:24:12 DEBUG rasa_core.training.generator - Data generation rounds finished.

2019-02-22 12:24:12 DEBUG rasa_core.training.generator - Found 0 unused checkpoints 2019-02-22 12:24:12 DEBUG rasa_core.training.generator - Found 3 training trackers. 2019-02-22 12:24:12 INFO main - Finished graph creation. Saved into file://C:\Projects\GenericChatBotDemo\code\application\chatbot\rasa\graph.png

Can anybody help?

Thanks in advance

I just got the same error.

2019-03-06 12:30:06 INFO main - Finished graph creation. Saved into file://C:\starter-pack-rasa-stack\graph.png

Then when trying to open it I get a message that it cannot be opened.

I installed pygraphviz through conda:

conda install graphviz pygraphviz -c alubbock

I’m using Windows 10 and Python 3.6, with that combination cannot install it through pip.

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