RasaHQ / rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
https://rasa.com/docs/rasa/
Apache License 2.0
18.84k stars 4.62k forks source link

AttributeError: 'function' object has no attribute 'train_dialogue_model' #3627

Closed tiwo19 closed 5 years ago

tiwo19 commented 5 years ago

Python version: = python3.7

rasa-core 0.14.4 rasa-core-sdk 0.14.0 rasa-nlu 0.15.0

Windows 10 Issue: I get this error when i run python train_online.py WARNING:tensorflow:From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. 2019-05-28 18:37:01 WARNING tensorflow - From C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. INFO:tensorflow:Restoring parameters from ./models/nlu/default/college_bot\component_5_EmbeddingIntentClassifier.ckpt 2019-05-28 18:37:01 INFO tensorflow - Restoring parameters from ./models/nlu/default/college_bot\component_5_EmbeddingIntentClassifier.ckpt Traceback (most recent call last): File "train_online.py", line 32, in agent = train_agent(interpreter) File "train_online.py", line 16, in train_agent return train.train_dialogue_model(domain_file="college_bot_domain.yml", AttributeError: 'function' object has no attribute 'train_dialogue_model'

Content of configuration file (config.yml): language: "en"

pipeline: "tensorflow_embedding"

training_data, augmentation_factor=50, epochs=500, batch_size=10, validation_split=0.2 ```yml


**Content of domain file (domain.yml)** (if used & relevant):
slots:
  group:
    type: text

intents:
 - greeting
 - get_jabu

entities:
 - product
 - jabuinfo

templates:
  utter_greet:
    - "Hello! What can I do for you?"
  utter_JABU:
   - "The Joseph Ayo Babalola University (JABU) is a private Nigerian university located in Ikeji-Arakeji in Osun State, established by the Christ Apostolic Church (CAC) Worldwide. The university is named after the first Spiritual leader of Christ Apostolic Church, Joseph Ayo Babalola (1904–1959); it is located at the place where he was called by God to slay the Ogobungo ogre in 1928. Joseph Ayo Babalola University is a fully residential institution. The university offers courses in the following colleges; Agricultural Sciences, Environmental Sciences, Humanities, Law, Management Sciences, Natural Sciences and Social Sciences. Due to its Christian foundations, male and female in the school are enjoined to adopt an extremely modest mode of dressing while on campus"
actions:
 - utter_greet
 - utter_JABU

```yaml
tiwo19 commented 5 years ago

@rasa any help please

akelad commented 5 years ago

What does your train_online.py file contain?

tiwo19 commented 5 years ago

this is what it contains from future import absolute_import from future import division from future import print_function from future import unicode_literals

import logging

from rasa_core import utils, train, run from rasa_core.training import interactive from rasa_core.interpreter import NaturalLanguageInterpreter

logger = logging.getLogger(name)

def train_agent(interpreter): return train.train_dialogue_model(domain_file="college_bot_domain.yml", stories_file="./data/stories.md", output_path="./models/dialogue", nlu_model_path=interpreter, endpoints="endpoints.yml", max_history=2, kwargs={"batch_size": 50, "epochs": 200, "max_training_samples": 300 })

if name == 'main': utils.configure_colored_logging(loglevel="DEBUG") nlu_model_path = "./models/nlu/default/college_bot" interpreter = NaturalLanguageInterpreter.create(nlu_model_path) agent = train_agent(interpreter) online.serve_agent(agent)

tiwo19 commented 5 years ago

@akelad sorry for my late respond i need help please

akelad commented 5 years ago

Can I ask where you got this code from? The function train_dialogue_model does not exist. Please take a look at our documentation on how to train a model. Please ask any further questions you have in our forum

tiwo19 commented 5 years ago

i got the code from a book please is there a new method to do this

akelad commented 5 years ago

Can I ask which book? If you take a look at the documentation you can find the commands to train a new model. With rasa 1.0, running rasa train should suffice. Otherwise python -m rasa_core.train ...

tiwo19 commented 5 years ago

Building Chatbots with Python.pdf

On Tue, Jun 4, 2019 at 9:09 AM Akela Drissner-Schmid < notifications@github.com> wrote:

Can I ask which book? If you take a look at the documentation you can find the commands to train a new model. With rasa 1.0, running rasa train should suffice. Otherwise python -m rasa_core.train ...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RasaHQ/rasa/issues/3627?email_source=notifications&email_token=AHG4DAS4FEW4TLVKTRSRAVTPYYPLDA5CNFSM4HQFWAF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW3YYFA#issuecomment-498568212, or mute the thread https://github.com/notifications/unsubscribe-auth/AHG4DAUKJVLEYAQYPKKAEODPYYPLDANCNFSM4HQFWAFQ .