I suddenly realized, would it be a environment variable problem? My environment: Windows 10 + Anaconda virtual env Python 3.5. But all other functions of anaconda and python work just fine…
Just tried, didn’t work, same result …
Also, if I train only rasa core rasa train core
rasa.core.training.generator - There is no starting story block in the training data. All your story blocks start with some checkpoint.
There should be at least one story block that starts without any checkpoint.
That’s strange, this is the first training of core and certainly it has no checkpoint been saved, but what’s the right way to train core, or train both nlu and core after rasa init?
Yes, that’s what I mean. When I run rasa train core -s ./data/stories/story_0.md, got:
Training Core model...
Processed Story Blocks: 0it [00:00, ?it/s]
2019-07-31 00:25:29 WARNING rasa.core.training.generator - There is no starting story block in the training data. All your story blocks start with some checkpoint. There should be at least one story block that starts without any checkpoint.
2019-07-31 00:25:29 INFO rasa.core.policies.ensemble - Skipped training, because there are no training samples.
d:\anaconda3\envs\rasa\lib\site-packages\rasa\core\policies\keras_policy.py:293: UserWarning: Method `persist(...)` was called without a trained model present. Nothing to persist then!
"Method `persist(...)` was called "
2019-07-31 00:25:29 INFO rasa.core.agent - Persisted model to 'C:\Users\ADMINI~1\AppData\Local\Temp\2\tmpznu2eqzk\core'
Core model training completed.
which means rasa receives empty story.
Actually, I modified rasa source code rasa/rasa/train.py line140 to see what exactly happend here, I print out the story that rasa received:
if stories.is_empty():
print_warning("No stories present. Just a Rasa NLU model will be trained. \n%r\n" % stories.as_story_string())
exit()
and it outputs:
No stories present. Just a Rasa NLU model will be trained.
''
the string with length of zero indicates that something is wrong. But strange thing is, if I run rasa init then rasa train, everything is just fine. I even checked encoding of story_0.md file, but nothing new.
The reasons why rasa couldn’t find story_0.md were:
We know that nlu training data and core training data both support markdown format, but the way rasa recognizing if it’s an nlu training data file or a core training data file, was heuristic: if a .md file contains any element from
_markdown_section_markers: ['## intent:', '## synonym:', '## regex:', '## lookup:'], then it will be added to nlu training data, otherwise it belongs to stories. This seems reasonable, since these four elements are used in nlu markdown file.
The tricky things here are, some of my story blocks begin with "## intent: ..." therefore the whole file was considered as nlu training data.
When I modified all "## intent: ..." in story to "## intent_...", rasa was able to find stories and to train core.
Maybe rasa can optimize the way recognizing nlu and story files.
And when I read the source code, I felt like, it was a bit difficult to debug the source code when all command can only be executed in cmd/bash, I have to insert many print() funcs to see the values of suspicious variables…maybe it has a better way, hope someone can suggest a better way to do this .
I didn’t have ##intent: … in my stories file but I still get this error. The file is in the correct path but it doesn’t recognize it as a stories file. I’ve already spent hours on this. This is just crazy. I didn’t have this issue in the previous version.
You have to be very careful with the format, try to use a text editor that will highlight the space, tab and other things and go through stories line by line… there’s no better way… hope RASA will develope some kind of format-checking tools to indicate those things…
The warning here helped me. " / symbol is reserved as a delimiter to separate retrieval intents from response text identifiers." I used this symbol in my intent name. I changed that and the problem was gone.