-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TypeTransformer for reading and writing from TensorFlowRecord format (#…
…1240) * first commit Signed-off-by: Ryan Nazareth <[email protected]> * add tensorflow example tf record transformer Signed-off-by: Ryan Nazareth <[email protected]> * refactor Signed-off-by: Ryan Nazareth <[email protected]> * correct tfexample description Signed-off-by: Ryan Nazareth <[email protected]> * fix test_native.py Signed-off-by: Ryan Nazareth <[email protected]> * add tensorflow docs and reqs Signed-off-by: Ryan Nazareth <[email protected]> * add tensorflow docs and reqs1 Signed-off-by: Ryan Nazareth <[email protected]> * tensorflow import in init Signed-off-by: Ryan Nazareth <[email protected]> * fix failing tests Signed-off-by: Ryan Nazareth <[email protected]> * add tensorflow pinned version to reqs Signed-off-by: Ryan Nazareth <[email protected]> * pin grpcio-status to remove protobuf error Signed-off-by: Ryan Nazareth <[email protected]> * add suggested changes Signed-off-by: Ryan Nazareth <[email protected]> * redesign transformer Signed-off-by: Ryan Nazareth <[email protected]> * remove old script Signed-off-by: Ryan Nazareth <[email protected]> * fix type reference for TFREcordDataset Signed-off-by: Ryan Nazareth <[email protected]> * refactor Signed-off-by: Ryan Nazareth <[email protected]> * refactor Signed-off-by: Ryan Nazareth <[email protected]> * spacing and uppercase Signed-off-by: Ryan Nazareth <[email protected]> * redesign with tfdir and tfrecordfile subclass Signed-off-by: Ryan Nazareth <[email protected]> * fix conflicts and typos Signed-off-by: Ryan Nazareth <[email protected]> * address majority of comments Signed-off-by: Ryan Nazareth <[email protected]> * refactor Signed-off-by: Ryan Nazareth <[email protected]> * fix test with flytefile and metadata annotated Signed-off-by: Ryan Nazareth <[email protected]> * fix check for example records in directory Signed-off-by: Ryan Nazareth <[email protected]> * refactor and correct typing Signed-off-by: Ryan Nazareth <[email protected]> * lint Signed-off-by: Ryan Nazareth <[email protected]> * import annotated from typing_extensions Signed-off-by: Ryan Nazareth <[email protected]> * tweak to tests to test case when Config not passed in as type Signed-off-by: Ryan Nazareth <[email protected]> * add suggested changes Signed-off-by: Ryan Nazareth <[email protected]> * add task for tfrecord dir with no config in test Signed-off-by: Ryan Nazareth <[email protected]> * get filenames from local dir instead of remote Signed-off-by: Ryan Nazareth <[email protected]> Signed-off-by: Ryan Nazareth <[email protected]>
- Loading branch information
1 parent
5c6d0ec
commit 21adb7b
Showing
13 changed files
with
517 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
############ | ||
TensorFlow Type | ||
############ | ||
.. automodule:: flytekit.extras.tensorflow | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
Flytekit TensorFlow | ||
========================================= | ||
.. currentmodule:: flytekit.extras.tensorflow | ||
.. autosummary:: | ||
:template: custom.rst | ||
:toctree: generated/ | ||
TensorFlowRecord | ||
""" | ||
from flytekit.loggers import logger | ||
|
||
# TODO: abstract this out so that there's an established pattern for registering plugins | ||
# that have soft dependencies | ||
try: | ||
# isolate the exception to the tensorflow import | ||
import tensorflow | ||
|
||
_tensorflow_installed = True | ||
except (ImportError, OSError): | ||
_tensorflow_installed = False | ||
|
||
|
||
if _tensorflow_installed: | ||
from .record import TensorFlowRecordFileTransformer, TensorFlowRecordsDirTransformer | ||
else: | ||
logger.info( | ||
"We won't register TensorFlowRecordFileTransformer and TensorFlowRecordsDirTransformer " | ||
"because tensorflow is not installed." | ||
) |
Oops, something went wrong.