-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at ../caffe2/serialize/inline_container.cc:132) #1943
Comments
Hi, I suppose you are trying to use torchscript to convert the model to mobile, is that correct? I suspect that this might not work out-of-the-box currently, because PyTorch mobile doesn't yet support using operators registered outside of PyTorch (like @dreiss is that still the case? |
Yes, but I think this issue is unrelated. It's just due to a change in the serialization format (which I think was reverted). |
Ok, following @dreiss comment, if you update PyTorch and torchvision this issue should go away, but you'll still have issues exporting keypoint-rcnn to mobile. |
Yes @fmassa you are correct. I used pytorch 1.4 snapshot as a dependency, above error disappeared. But still I am getting build failed that even without showing any error. Now I am confused with what should be exact issue. |
@hurricane013 as I mentioned in the above post, we currently do not support exporting keypoint-rcnn to mobile yet unfortunately, but support for it will be added in future releases. |
Hi, I wrote a simple MNIST classifier with CNN and got the same error on my android project.
|
@hurricane013 simple CNN models should work with mobile, I would expect this to be a version issue and if you update PyTorch / torchvision and re-save your weights, it should work |
I see.
and this is what I added to dependencies. implementation 'org.pytorch:pytorch_android:1.4.0' Should I install pytorch's 1.4 version or is there any implementation for 1.5? |
Yes, I think you might want to install PyTorch 1.4 and torchvision 0.5.0. But I would recommend posting this question on the pytorch discuss forums, as this is outside of the scope of torchvision and I don't have much context to be able to help with android-specific issues |
@fmassa As I mentioned, I used 1.4 snapshot which is latest as a dependency in my android app, but i am still getting build failed without any error. |
If anyone encounters this, this is what happened to me:
To fix it, I removed the dataset that torchvision had already downloaded. |
@jxmorris12 maybe doing new colab env is much easier... It just happend to me....so ANNOYING!! |
I'm having the same issues on frame #35: __libc_start_main + 0xf0 (0x7f0dfb530840 in /lib/x86_64-linux-gnu/libc.so.6) |
I ran into the same problem with pytorch 1.4 |
The model you are trying to load is trained on PyTorch V1.6 or above. Upgrade your PyTorch version to 1.6. |
Does anyone know how I can reshape Tensor object on android? |
The model trained with PyTorch 1.7 and the backbone is resnet50 , but PyTorch version 1.4 loading the model occurred the same error |
Update pytorch latest versions. Follow this link; https://pytorch.org/mobile/android/#using-the-nightly-pytorch-android-libraries |
Make sure both Python version and Android version of PyTorch is the same. |
what fixed your issue? and were you using python2? @chinglamchoi |
I had the same problem when using the |
Use PyTorch 1.4 and torchvision 0.5.0, it solves some cases. |
I have created .pt file of keypoint_rcnn using torch=1.5 and vision=0.6.0 now trying to integrate it with my android app. The error I am getting is as below.
The text was updated successfully, but these errors were encountered: