Hi,
I downloaded snpe-1.64.0.3605, and ran the alexnet caffe examples without issue. Next, I tried the pytorch example with resnet18. I ran the following commands:
$ python3 // Python 3.6.9, Ubuntu 18.04
>>> import torch
>>> import torchvision.models as models
>>> resnet18_model = models.resnet18()
>>> input_shape = [1, 3, 224, 224]
>>> input_data = torch.randn(input_shape)
>>> script_model = torch.jit.trace(resnet18_model, input_data)
>>> script_model.save("resnet18.pt")
>>> exit()
$ snpe-pytorch-to-dlc --input_network resnet18.pt --input_dim input "1,3,224,224" --output_path resnet18.dlc
Console Output ->
Check failed: (reporter->AssertEQ(data->shape[data->shape.size() - 1], weight->shape[1])) is false: DenseRel: input dimension doesn't match, data shape=[1, 512], weight shape=[512, 1000]
Please confirm I followed the steps correctly or if I did something wrong.
Thanks,
Jason
hello
The document mentions that --input-dim must be followed by value in quotes as follows:
snpe-pytorch-to-dlc --input_network resnet18.pt --input_dim 'input' 1,3,224,224 --output_path resnet18.dlc
https://developer.qualcomm.com/sites/default/files/docs/snpe/tools.html
See here:
Hi ss.pandiri,
Thanks for your response. I tried running the same command using quotes as you suggested, but I received the same error from TVM. However, it turns out the issue was that I had installed pytorch 1.12. After uninstalling pytorch and torchvision, then reinstalling pytorch (and torchvision) v1.8.1, I was able to run snpe-pytorch-to-dlc without issue.
Thank you for your help.
Jason