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

Threaded tensorflow training on python 3 #1439

Merged
merged 6 commits into from Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -20,6 +20,9 @@ Removed

Fixed
-----
- Allow training of pipelines containing ``EmbeddingIntentClassifier`` in
a separate thread on python 3. This makes http server calls to ``/train``
non-blocking


[0.13.5] - 2018-09-28
Expand Down
7 changes: 4 additions & 3 deletions rasa_nlu/data_router.py
Expand Up @@ -10,6 +10,7 @@
from concurrent.futures import ProcessPoolExecutor as ProcessPool
from typing import Text, Dict, Any, Optional, List

import six
from builtins import object
from twisted.internet import reactor
from twisted.internet.defer import Deferred
Expand Down Expand Up @@ -358,9 +359,9 @@ def training_errback(failure):
self._current_training_processes += 1
self.project_store[project].current_training_processes += 1

# tensorflow training is not executed in a separate thread, as this may
# cause training to freeze
if self._tf_in_pipeline(train_config):
# tensorflow training is not executed in a separate thread on python 2,
# as this may cause training to freeze
if six.PY2 and self._tf_in_pipeline(train_config):
try:
logger.warning("Training a pipeline with a tensorflow "
"component. This blocks the server during "
Expand Down