Closed yemreeee closed 2 years ago
I forget the gradle version of pytorch lite. Set 'org.pytorch:pytorch_android_lite:1.9.0' to 1.10.0.
convert2version5 = True
if convert2version5:
from torch.jit.mobile import (
_backport_for_mobile,
_get_model_bytecode_version,
)
MODEL_INPUT_FILE = "type2_model_v7.ptl"
MODEL_OUTPUT_FILE = "type2_model_v5.ptl"
print("model version", _get_model_bytecode_version(f_input=MODEL_INPUT_FILE))
_backport_for_mobile(f_input=MODEL_INPUT_FILE, f_output=MODEL_OUTPUT_FILE, to_version=5)
print("new model version", _get_model_bytecode_version(MODEL_OUTPUT_FILE))
How do i resolve this? Every pytorch example (Especially android) that i tried, i have same problem. Thanks for your comments in advance.