Hi,
I have a simple PyTorch module that executes a depthwise convolution.
Complete Code
class Depthwise(torch.nn.Module):
trace_and_save(bugModule, [torch.randn(input_shape)], 'depthwise.pt')
snpe-pytorch-to-dlc will convert the model without terminating with an error, but provides the runtime warning:
$ snpe-pytorch-to-dlc -i depthwise.pt --input_dim 'input_0' 1,12,288,480 --debug
ERROR - snpebm.snpebm_device: ['error_code=1002; error_message=Layer parameter value is invalid. error_code=1002; error_message=Layer parameter value is invalid. Layer depthwise_convolution_0: input depth should be evenly divisible by group parameter; error_component=Model Validation; line_no=992; thread_id=-225721888; error_component=Model Validation; line_no=342; thread_id=-183237516']
Clearly the input depth (12) and the groups (12) are equal, and so input depth is evenly divisible by group parameter
Dependencies:
- snpe: 1.66.0.3729
- torch: 1.11 (also same issue with 1.8)
DLC file: depthwise.dlc: https://drive.google.com/file/d/1n13g07X6mExJp1hWa0tYojA4sE2QfIcV/view?u...
PT file: depthwise.pt: https://drive.google.com/file/d/1anTHbFizVczXMrz9JpKpBz8YEWAu2lER/view?u...
Hi,
Please check the command you have used snpe-pytorch-to-dlc, you need to provide -o output_path followed by output file(.dlc) where you want to save your dlc model.
If not specified, the converter model will be written to a file with same name as the input model.
Please check the link given: https://developer.qualcomm.com/sites/default/files/docs/snpe/tools.html#...
Thanks.
That is incorrect, the output path is not required. As you can observe in my first post, I have depthwise.pt and depthwise.dlc attached and generated using my code, which you could have easily verified. Your response has nothing to do with the problem of my question.
The argument -o is not required (look at the link you sent and you will see it's optional), furthermore, if you don't specify -o to snpe-pytorch-to-dlc, it will generate a new file like this <input-file-name>.dlc, eg:
$ snpe-pytorch-to-dlc -i input_file.pt ...
Results in the output file input_file.dlc