djl
djl copied to clipboard
It seems to be some problems when load faster Rcnn by pytorch model
When I load a faster rcnn model from pytorch's TorchScript model It says unknows torchvision::nms
@yang162132 Thanks for reporting the issue. It is expected as the NMS operator is implemented in TorchVision and not part of libtorch.
@yang162132 We current don't support torchvision/torchtext, see: #1394
@frankfliu Is there some ways to use torchvision.dll?
torchvision.dll depends on python, I didn't find a way to load into Java process.
OH, that's terrible, it's seem that hard to use faster rcnn model trained by pytorch
Hello guys, any news on that issue? I saw the issue you linked on torch's side was resolved: https://github.com/pytorch/vision/issues/2692 I got a similar issue (just another operation missing) when scripting a model including the torchvision transforms and I am hoping that this will be resolved once you guys release PyTorch engine building for their version 1.12.1? Thanks in advance!
@aditen Will revisit this issue.
At the mean time, can you try to load torchvision with DJL use:
export PYTORCH_EXTRA_LIBRARY_PATH=python3.9/site-packages/torchvision/_C.so
@frankfliu Thanks a lot for your support! This env variable resolved my issue of using scriptable transforms in my model. On my Windows environment the file extension of the _C file turned out to be .pyd, but worked just as well.
As we plan to use DJL in combination with torchvision in a docker environment, it would be a bit complicated to deploy it this way as it requires including the .so file specifically as I understand it. Is there a chance of this becoming part of the DJI pytorch package or maybe an additional/extended maven package?
@frankfliu Thanks a lot for your support! This env variable resolved my issue of using scriptable transforms in my model. On my Windows environment the file extension of the _C file turned out to be .pyd, but worked just as well.
As we plan to use DJL in combination with torchvision in a docker environment, it would be a bit complicated to deploy it this way as it requires including the .so file specifically as I understand it. Is there a chance of this becoming part of the DJI pytorch package or maybe an additional/extended maven package?
Hey! @aditen How did you do that.I tried it but no success.
play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[EngineException: Failed to load PyTorch native library]]
at play.api.http.HttpErrorHandlerExceptions$.$anonfun$convertToPlayException$2(HttpErrorHandler.scala:381)
Caused by: ai.djl.engine.EngineException: Failed to load PyTorch native library
at ai.djl.pytorch.engine.PtEngine.newInstance(PtEngine.java:90)
at ai.djl.pytorch.engine.PtEngineProvider.getEngine(PtEngineProvider.java:40)
at ai.djl.engine.Engine.getEngine(Engine.java:187)
at ai.djl.engine.Engine.getInstance(Engine.java:142)
at ai.djl.ndarray.NDManager.newBaseManager(NDManager.java:130)
Caused by: java.lang.UnsatisfiedLinkError: D:\ProgramData\Anaconda3\envs\torch\Lib\site-packages\torchvision\_C.pyd: 找不到指定的程序。
@yang162132
Can you use dumpbin to check if all torchvision dll dependencies are in the PATH