-
Notifications
You must be signed in to change notification settings - Fork 5
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
compile_pytorch_model.py compile failures (model_path/constants.pkl not found) #22
Comments
@ljkeller I have the exact same issue. Were you able to fix it? |
I remember having multiple issues that day. I know I put a PR; I don't think its related? #23 worth looking at. Otherwise, IIRC, this was a torch or python versioning issue. Unfortunately the best advice I'd have is to binary search through python/torch versions. I think one of the python versions changed model exporting. I think a shortcut is to check for constants.pkl, but I don't remember very well. I've found ONNX to be much friendlier to use, but even that has an implicit versioning requirement. @matinlotfali please let me know if you get around the issue. |
I just learned that the PyTorch model file should be converted to a TorchScripted model via |
I've definitely compiled torch models without doing this explicitly. Do you have a link so I can read up on this? That's frustrating. |
I think this is a nice reading material: https://www.geeksforgeeks.org/what-are-torch-scripts-in-pytorch/ |
Yes, but I was looking for an explicit callout of the necessity of the jit. Even the TVM docs don't appear to say much from what I've seen.
is all their torch compile guide says.. I think this is a recipe for wasted developer time. I could add a failure log warning to tutorials/compile_pytorch_model*.py files on the jit.load if anyone thinks that would be useful? That or some documentation could be updated- I'm not sure where. @hiroyuki-sakamoto seems to be listening. What do you think? |
Sorry for the delay in responding due to the confusion that accompanied the v2.4.0 release. |
Hello,
I'm having compile failures with
compile_pytorch_model.py
. Heres my failure:Interestingly, I trained this model and deployed to both torch and onnx formats. The onnx export works
python3 compile_onnx_model.py /home/models/spark.onnx -o spark -s 1,3,28,28 -i input
.I'm guessing there is a version incompatibility with the torch I trained/exported on and the torch used here for the conversion? I don't see any documentation about expected torch training versions. I don't have my model training PC with me right now, or I'd report the torch version.
Here are the models I've tried spark.zip
Environment
I'm running out of a docker container I built ~6 months ago with
docker build -t rzv2l_ai_sdk_image --build-arg SDK="/opt/poky/3.1.21" --build-arg PRODUCT="V2L"
as far as I know.The text was updated successfully, but these errors were encountered: