-
Notifications
You must be signed in to change notification settings - Fork 717
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
Improve recommender tutorial by updating code to be usable outside of InteractiveContext #5885
Comments
@rcrowe-google I see you published the original tutorial. Would you be willing to share your thoughts on this, whether its a worthwhile improvement, and possibly clarify why the code works when using the |
Hi @TaylorZowtuk - Yes, it would be worthwhile to update the example to work in |
Thanks for confirming and thanks for the clarification. I appreciate you taking the time to respond @rcrowe-google. |
Hello, I'm experiencing the same issue. Is there a workaround for this currently? |
Do we have any progress on this issue ? I'm experiencing the same issue. |
@lukhaza I believe you extended the |
I've extended the standard Trainer and Tuner components (as well as the The solution is general (supporting both "item" and "query" inputs), but in the context of this thread, you would pass the dataset of unique movies into |
URL(s) with the issue:
Description of issue (what needs changing):
The current notebook runs without issue and works as a starting point. For me (and I presume others) the next step is naturally to organize the code in a more production-like pipeline which means adapting the notebook and fitting it into something like the templates described in this guide.
However, if one adapts the recommender tutorial to run outside of
InteractiveContext
, then the code fails to run. In particular, theChannel
's that we pass to theTrainer
component are empty when the pipeline is run usingLocalDagRunner
. When theMovielensModel
callsmovies_uri.get()[0]
in its constructor, the program will throw aRuntimeError
because we are indexing into an empty list. This is in spite of the fact that the artifacts do exist in the local file system and previous components have run correctly.I created a fork and (arbitrarily) pushed my code here to illustrate exactly what I am running.
You can see the logs from a run here. In particular, look from this line onwards and you will see what
custom_config
evaluates to and the error.From my brief attempt at tracing through the TFX code for the
Trainer
component, it seems that the executors track or resolve the artifacts for the non-custom_config
arguments (likeexamples
,transform_graph
, andschema
) differently than thecustom_config
arguments. That is whytrain_files
inrun_fn()
is a valid path while the custom_config values are emptyChannel
's. But I am uncertain of why there is a difference depending on the orchestrator used and what the correct way to resolve this is.This is not a new confusion, as you can see others have come across the same situation as myself. Unfortunately, that question was never answered and I was also unable to find any answers in any of the TensorFlow repos/docs or other stack overflow posts. I hope that this issue can clarify the correct way to approach this situation and help others avoid the same mistake in the future.
Why this should be changed:
I would like to request that the tutorial be updated because:
The text was updated successfully, but these errors were encountered: