-
Notifications
You must be signed in to change notification settings - Fork 100
Backward compatibility of ptl with live.spec on iOS #78
Comments
Hi @SomaKishimoto. Live Spec support will be removed in the future, but in 0.2.0 it should continue to work as before. Is it possible the model is returning a different format than before, or that the Live Spec has changed? Here is the code where that error is raised: https://github.com/facebookresearch/playtorch/blob/v0.2.0/react-native-pytorch-core/ios/ML/Processing/Unpacker/BoundingBoxesUnpacker.swift#L19-L34 That code is looking for a specific shape for the values in the Live Spec (variable |
@chrisklaiber, thank you for the prompt response.
No, I haven't changed the Live Spec and any format in the model.
Yes, I checked it several times, but didn't get hints to solve this error. Please let me know if you have any idea to solve the problem than the mentioned above. |
@SomaKishimoto, can you provide the live.spec.json that's packed with the model and the Alternatively, we recommend migrating to the PlayTorch SDK JavaScript API. We can provide support when the |
@raedle, Here is live.spec.json and def forward. live.spec.json
def forward
Maybe it's time to migrate to PlayTorch SDK JavaScript API. |
@SomaKishimoto, we found the culprit. After upgrading the LibTorch-Lite library from version Alternatively, as mentioned, it might be worth upgrading to the new PlayTorch SDK JavaScript API. The You'd have to change the // Normalize the tensor image with mean and standard deviation
const normalize = T.normalize([0.0, 0.0, 0.0], [0.0039216, 0.0039216, 0.0039216]);
tensor = normalize(tensor); The // Resize the image tensor to 3 x min(height, width)
const resize = T.resize([scaleHeight, scaleWidth]);
tensor = resize(tensor); In the Let me know if you have question or need advice! |
@raedle , thanks for resolving the issue! I've verified that your fix works fine. I will try to upgrade to the new PlayTorch SDK JavaScript API by referring to your explanation and let you know if I get stuck. Thank you always! |
Summary: Pull Request resolved: #99 The object detection unpacker fails to return results as reported in #78. After the LibTorch-Lite upgrade from `1.10.0` to `1.12.0`, the IValue kind type changed to `c10::DynamicKind`, which wraps the original kind type. This change updates the `PTMIValue.mm` wrapper to work with the dynamic kind. Reviewed By: chrisklaiber Differential Revision: D38451372 fbshipit-source-id: 7c209102308cbc21a2985d82d05de2dd681a3dc7
Fantastic to hear that the issue is resolved, @SomaKishimoto! I'll close the issue, then |
Version
0.2.0
Problem Area
react-native-pytorch-core (core package)
Steps to Reproduce
the project works well in 0.1.3, but the error comes up after upgrade to 0.2.0.
Is there no backward compatibility for ptl with live.spec?
No problem on Android.
Expected Results
No error
Code example, screenshot, or link to repository
No response
The text was updated successfully, but these errors were encountered: