Closed dilankadias closed 6 years ago
@dilankadias I just checked my code and found that I actually left one parameter as per old version of Rasa Core, so thanks a lot for reporting this! :) . Since the release of Rasa Core v0.9.0 the parameter max_history has to be priovided directly to the policy, for example:
agent = Agent(domain_file,
policies=[MemoizationPolicy(max_history=5),
KerasPolicy(featurizer)])
I forgot to make this change inside the train_init.py file and this is why it was failing. I have made a commit with an updated code so it should be fixed by now. Give it a go let me know if the problem persists :)
@JustinaPetr : Thank you so much, I solved the issue. But I encountered another problem and I have sent you an email to your email address mentioned in your github account (juste@rasa.com). Can you please check your your email inbox? Thanks,
(base) C:\Users\sumit\Desktop\Xtra1\chatbot\Python Bot\WeatherBot\Mybot>python dialogue_management_model.py
C:\Users\sumit\Anaconda3\lib\site-packages\h5py__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float
to np.floating
is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type
.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
Traceback (most recent call last):
File "dialogue_management_model.py", line 54, in
(base) C:\Users\sumit\Desktop\Xtra1\chatbot\Python Bot\WeatherBot\Mybot>python dialogue_management_model.py
Traceback (most recent call last):
File "dialogue_management_model.py", line 17, in
Please help with this issue
after passing the following parameter . agent = Agent('weather_domain.yml', policies=[MemoizationPolicy(max_history=5), KerasPolicy(featurizer)]) I am getting this error KerasPolicy(featurizer)]) NameError: name 'featurizer' is not defined
I am having the same problem.
@dilankadias I just checked my code and found that I actually left one parameter as per old version of Rasa Core, so thanks a lot for reporting this! :) . Since the release of Rasa Core v0.9.0 the parameter max_history has to be priovided directly to the policy, for example:
agent = Agent(domain_file, policies=[MemoizationPolicy(max_history=5), KerasPolicy(featurizer)])
I forgot to make this change inside the train_init.py file and this is why it was failing. I have made a commit with an updated code so it should be fixed by now. Give it a go let me know if the problem persists :)
The code is not working I got an errof "Featurizer is not defined" Please help with the issue. Thanks
I ran into the same problem. Since I couldn’t find anything on the internet, I took a closer look at @JustinaPetr ’s GitHub repo and tried it out for myself with the help of her files. For me this example works perfect:
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
from rasa_core.agent import Agent
from rasa_core.policies.keras_policy import KerasPolicy
from rasa_core.policies.memoization import MemoizationPolicy
if __name__ == '__main__':
logging.basicConfig(level='INFO')
training_data_file = './data/stories.md'
model_path = './models/dialogue'
agent = Agent('my_domain.yml', policies = [MemoizationPolicy(max_history=2), KerasPolicy(max_history=3)])
data = agent.load_data(training_data_file)
agent.train(data)
agent.persist(model_path)
If you have problems with _trainonline.py, check out Justina's GitHub repo. She recently updated this Python script.
from future import absolute_import from future import division from future import unicode_literals
import logging
from rasa_core.agent import Agent from rasa_core.policies.keras_policy import KerasPolicy from rasa_core.policies.memoization import MemoizationPolicy from rasa_core.featurizers import (MaxHistoryTrackerFeaturizer, BinarySingleStateFeaturizer)
if name == 'main': logging.basicConfig(level='INFO')
training_data_file = './data/stories.md'# provided the file with sample stories
model_path = './models/dialogue' # Path where i store my model
featurizer = MaxHistoryTrackerFeaturizer(BinarySingleStateFeaturizer(), max_history=5)
agent = Agent('restaurant_domain.yml', policies = [MemoizationPolicy(max_history = 4), KerasPolicy(featurizer)]) # provided the domain file
agent.train(
training_data_file,
augmentation_factor = 50,
#max_history = 4, # comment this to solve the issue
epochs = 500,
batch_size = 30,
validation_split = 0.2)
agent.persist(model_path)
For me commenting the max_history in agent.train method solved the issue
if this change done then new error is appearing
Traceback (most recent call last):
File ".\train_init.py", line 1, in
@dilankadias I just checked my code and found that I actually left one parameter as per old version of Rasa Core, so thanks a lot for reporting this! :) . Since the release of Rasa Core v0.9.0 the parameter max_history has to be priovided directly to the policy, for example:
agent = Agent(domain_file, policies=[MemoizationPolicy(max_history=5), KerasPolicy(featurizer)])
I forgot to make this change inside the train_init.py file and this is why it was failing. I have made a commit with an updated code so it should be fixed by now. Give it a go let me know if the problem persists :)
please share the latest code link where its fixed
I get this error when I try to run python train_init.py. Please help!!