Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #1069, importing
tflearn
can be very slow due to it importing all oftensorflow.contrib
.This PR significantly improves import speed:
This is achieved by lazy-loading any
tensorflow.contrib
components that would otherwise be always loaded, with some caveats:tflearn.initializations.xavier
and.variance_scaling
will be slowtflearn.data_utils.VocabularyProcessor
no longer inherits fromtensorflow.contrib.learn.python.learn.preprocessing.text.VocabularyProcessor
, which might break someisinstance()
calls in user code.tensorflow/contrib/framework/python/ops/arg_scope.py
file is vendored intflearn
.Regarding
VocabularyProcessor
, though – it looks like the class did nothing more than wrap calls to its superclass, so maybe it should be removed altogether with a note to have people use the superclass directly instead (though it too is deprecated since TensorFlow 1.7.0).Closes #1069