Thank you. When changing the import order, it turns out pytorch is not installed. I installed it following this tutorial:
Note that the indicated link for the wheel is wrong, but it was easy to fix.
Now it seems to work, but I have the following message when running the script:
vpi_pytorch.py:51: UserWarning: The given NumPy array is not writable, and PyTorch does not support non-writable tensors. This means writing to this tensor will result in undefined behavior. You may want to copy the array to protect its data or make it writable before converting it to a tensor. This type of warning will be suppressed for the rest of this program. (Triggered internally at …/torch/csrc/utils/tensor_numpy.cpp:199.)
Is it expected?
And the script is really slow: on a 1900x1200 image, with the ORIN in MAXN mode, it takes around 5s (import times have been removed) to simply blur it and do a basic math operation.
Did you had the opportunity to investigate this suspicious behavior?
In the meantime, maybe you can answer the question I wanted to solve: I wanted to check if vpi convolutions are faster than pytorch convolutions. Do you know if it is the case? Or is it the same?
And is there a way in vpi to perform basic arithmetic operations ( + - * / ) on images like adding 2 images using GPU? And if yes how does it compare to torch implementations?
VPI doesn’t support element-wise operations like + or -.
But we do have another library called TensorRT that can give you a better performance compared to PyTorch.