Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rajasingam7 opened this issue Aug 18, 2019 · 1 comment

Comments

@rajasingam7
Copy link

hi Sumit,
Thanks for the wonderful book. It really help us to get confident in working chatbot.

I have an issue during execution of train_online.py. "AttributeError: 'function' object has no attribute 'train_dialogue_model'". I have browsed and found that train_dailogue_model function is no more in use.

Initially i had an issue from rasa_core.training import online and i have changed to from rasa_core.training import interactive and executed the script and encounter this error. Kindly help me on this.

Version : 1.0.0rc2

Error:
C:\Users\HP\horoscope_bot>python train_online.py
2019-08-18 10:11:22.030464: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From C:\Users\HP\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-08-18 10:11:22 WARNING tensorflow - From C:\Users\HP\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/horoscopebot\component_5_EmbeddingIntentClassifier.ckpt
2019-08-18 10:11:22 INFO tensorflow - Restoring parameters from ./models/nlu/default/horoscopebot\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="horoscope_domain.yml",
AttributeError: 'function' object has no attribute 'train_dialogue_model'

Code:

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
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="horoscope_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/horoscopebot"
interpreter = NaturalLanguageInterpreter.create(nlu_model_path)
agent = train_agent(interpreter)
interactive.serve_agent(agent)

@jeruji
Copy link

jeruji commented Dec 10, 2020

have you found the solution of this?? @rajasingam7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants