You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/08/31 20:23:47 UTC

[GitHub] [beam] yeandy opened a new issue, #22979: [Bug]: Incorrect output shape in the RunInference PredictionResult object

yeandy opened a new issue, #22979:
URL: https://github.com/apache/beam/issues/22979

   ### What happened?
   
   Originally documented [here](https://beam.apache.org/documentation/sdks/python-machine-learning/#incorrect-inferences-in-the-predictionresult-object) in our RunInference Troubleshooting section:
   
   
   For some models, the PredictionResults output might not include the correct predictions in the inferences field. This issue occurs when you use a model whose inferences return a dictionary that maps keys to predictions and other metadata. An example return type is `Dict[str, Tensor]`.
   
   The RunInference API currently expects outputs to be an `Iterable[Any]`. Example return types are `Iterable[Tensor]` or `Iterable[Dict[str, Tensor]]`. When RunInference zips the inputs with the predictions, the predictions iterate over the dictionary keys instead of the batch elements. The result is that the key name is preserved but the prediction tensors are discarded.
   
   To work with the current RunInference implementation, you can create a wrapper class that overrides the model(input) call. In PyTorch, for example, your wrapper would override the forward() function and return an output with the appropriate format of `List[Dict[str, torch.Tensor]]`. 
   
   ### Issue Priority
   
   Priority: 2
   
   ### Issue Component
   
   Component: sdk-py-core


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] yeandy commented on issue #22979: [Bug]: Incorrect output shape in the RunInference PredictionResult object

Posted by GitBox <gi...@apache.org>.
yeandy commented on issue #22979:
URL: https://github.com/apache/beam/issues/22979#issuecomment-1234415254

   Yes, I forgot we created that 😆 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] damccorm closed issue #22979: [Bug]: Incorrect output shape in the RunInference PredictionResult object

Posted by GitBox <gi...@apache.org>.
damccorm closed issue #22979: [Bug]: Incorrect output shape in the RunInference PredictionResult object
URL: https://github.com/apache/beam/issues/22979


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] yeandy commented on issue #22979: [Bug]: Incorrect output shape in the RunInference PredictionResult object

Posted by GitBox <gi...@apache.org>.
yeandy commented on issue #22979:
URL: https://github.com/apache/beam/issues/22979#issuecomment-1233385312

   .add-labels run-inference


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] yeandy commented on issue #22979: [Bug]: Incorrect output shape in the RunInference PredictionResult object

Posted by GitBox <gi...@apache.org>.
yeandy commented on issue #22979:
URL: https://github.com/apache/beam/issues/22979#issuecomment-1234625944

   Ack, thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] damccorm commented on issue #22979: [Bug]: Incorrect output shape in the RunInference PredictionResult object

Posted by GitBox <gi...@apache.org>.
damccorm commented on issue #22979:
URL: https://github.com/apache/beam/issues/22979#issuecomment-1234606712

   Closing in favor of #22240 since its longer lived. I copied over your description from here though since I think its a little more context rich in places.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [beam] damccorm commented on issue #22979: [Bug]: Incorrect output shape in the RunInference PredictionResult object

Posted by GitBox <gi...@apache.org>.
damccorm commented on issue #22979:
URL: https://github.com/apache/beam/issues/22979#issuecomment-1234399963

   @yeandy is this different from #22240?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org