-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Python Backend complains "triton_python_backend_utils" has no attribute "InferenceRequest" #4743
Comments
@Tabrizian ^^^ |
Hi @Michael-Jing, sorry about the delay. Can you please share the structure of your model repository? Are you copying |
Opening a bug with the team to investigate further. Most likely it is a user issue. |
Hi, I found that the reason for the error is I defined a funciton with the following Signature in my worker.py
after I removed the pbu.InferenceRequest type annotation for request, it works fine. |
Thanks for updating us, Michael! Closing ticket. |
why remove type annotation would help? Or maybe I should ask, why use pbu.InferenceRequest would cause issue? |
I find this confusing as well - all the examples make use of the type |
We are also facing issues with
However, we tried to update the triton server to 23.08-py3, and now we get the following error:
When we remove the annotations, the model is loaded successfully. Why is this the case? |
Facing the same issue with Okay, I remove annotations... |
@Tabrizian @tanmayv25, any update here? The ticket was closed, but it seems like many people have issues with this. How can this class of bugs be fixed without removing annotations? I don't see a reason why it would be intended to stop supporting annotations. For me this is still a bug. |
Sorry, we haven't be able to still get to this issue. Will update you as soon as there are any updates. |
The issue appears to be the timing of when the stub is setup, i.e. If I use properties/methods of the python stub at the top level of my module, i.e. import triton_python_backend_utils as pb_utils
logger = pb_utils.Logger this fails with error: creating server: Invalid argument - load failed for model 'encoder': version 1 is at UNAVAILABLE state: Internal: AttributeError: module 'triton_python_backend_utils' has no attribute 'Logger' But the following works fine import triton_python_backend_utils as pb_utils
class TritonPythonModel:
def initialize(self, args: Dict[str, str]) -> None:
logger = pb_utils.Logger And I can use the So the script appears to be imported, then the stub is setup, then the model is initalised. The order would ideally be setup the stub, import the script then initalise the model. I've upgraded to 23.12 and still seeing this. |
I'm using the python business logic scripting, and a conda packed python environment with python3.8. Both 22.06 and 22.07 version show the following error message "UNAVAILABLE: Internal: AttributeError: module 'triton_python_backend_utils' has no attribute 'InferenceRequest'". but it works ok on the third party docker image flyingmachine/tritonserver-w-ort-1.11.0
The text was updated successfully, but these errors were encountered: