Closed etsyzlong closed 2 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.
Thank you @chongkong, the pipeline is working with the beam configurations.
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.
@etsyzlong
Closing this issue as it is resolved.Please feel free to reopen if this still exists.Thanks
System information
pip freeze
output): Relevant output:Describe the current behavior Running
python ranking_pipeline.py
fromhttps://github.com/tensorflow/tfx/blob/master/tfx/examples/ranking
directory yields the following error:Added
import struct2tensor
toline 20
of theranking_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: