tensorflow / tfx

TFX is an end-to-end platform for deploying production ML pipelines
https://tensorflow.org/tfx
Apache License 2.0
2.1k stars 706 forks source link

Cannot successfully execute the TFX examples ranking pipeline with LocalDagRunner #4007

Closed etsyzlong closed 2 years ago

etsyzlong commented 3 years ago

System information

Describe the current behavior Running python ranking_pipeline.py from https://github.com/tensorflow/tfx/blob/master/tfx/examples/ranking directory yields the following error:

FileNotFoundError: Op type not registered 'DecodeProtoSparseV3' in binary running on <machine_name>.

Added import struct2tensor to line 20 of the ranking_pipeline.py file did not resolve the issue.

Describe the expected behavior

Running python ranking_pipeline.py should run the ranking pipeline locally and successfully.

Standalone code to reproduce the issue

from tfx repo root:

cd tfx/examples/ranking
python ranking_pipeline.py
chongkong commented 3 years ago

Thanks @etsyzlong. This is a bug and we're tracking it. This happens because import struct2tensor does not happen inside the worker thread/subprocesses. For a quick fix, you may run the example with the following beam arguments:

beam_pipeline_args = [
    '--direct_running_mode=in_memory',
    '--direct_num_workers=1',
]

which basically runs the pipeline in the current thread. We are working on a fix for the multi thread/process environment, but is still on discussion and might take some time.

etsyzlong commented 3 years ago

Thank you @chongkong, the pipeline is working with the beam configurations.

eunicevin commented 3 years ago

If you need to run your pipeline in a multi-process environment like kubeflow or airflow, there is a workaround. Modify to import struct2tensor from tfx-bsl, package it and dockerization.

UsharaniPagadala commented 2 years ago

@etsyzlong

Closing this issue as it is resolved.Please feel free to reopen if this still exists.Thanks

google-ml-butler[bot] commented 2 years ago

Are you satisfied with the resolution of your issue? Yes No