spconv with jit script problem

username: XiaoHan0705
cooked: <p>Hello, everyone.<br>
I have to use spconv.conv.py,</p>
<p>I got error in this place.</p>
<p>Traceback (most recent call last):<br>
File “trace_smallnet.py”, line 27, in <br>
sm = torch.jit.script(net_middle)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 1162, in script<br>
return _convert_to_script_module(obj)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 1812, in _convert_to_script_module<br>
return WeakScriptModuleProxy(mod, stubs)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 1386, in init_then_register<br>
original_init(self, *args, **kwargs)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 1736, in <strong>init</strong><br>
_create_methods_from_stubs(self, stubs)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 1347, in _create_methods_from_stubs<br>
self._c._create_methods(self, defs, rcbs, defaults)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 982, in _make_strong_submodule<br>
new_strong_submodule = _convert_to_script_module(module)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 1812, in _convert_to_script_module<br>
return WeakScriptModuleProxy(mod, stubs)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 1386, in init_then_register<br>
original_init(self, *args, **kwargs)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 1736, in <strong>init</strong><br>
_create_methods_from_stubs(self, stubs)<br>
File “/home/liangdao/.local/lib/python3.6/site-packages/torch/jit/<strong>init</strong>.py”, line 1347, in _create_methods_from_stubs<br>
self._c._create_methods(self, defs, rcbs, defaults)<br>
RuntimeError:<br>
Arguments for call are not valid.<br>
The following operator variants are available:</p>
<p>aten::_set_item(Tensor<a></a> l, int idx, Tensor(b) el) -&gt; (Tensor<a></a>):<br>
Expected a value of type ‘List[Tensor]’ for argument ‘l’ but instead found type ‘Dict[str, Tensor]’.</p>
<p>aten::_set_item(int<a></a> l, int idx, int el) -&gt; (int<a></a>):<br>
Expected a value of type ‘List[int]’ for argument ‘l’ but instead found type ‘Dict[str, Tensor]’.</p>
<p>aten::_set_item(float<a></a> l, int idx, float el) -&gt; (float<a></a>):<br>
Expected a value of type ‘List[float]’ for argument ‘l’ but instead found type ‘Dict[str, Tensor]’.</p>
<p>aten::_set_item(bool<a></a> l, int idx, bool el) -&gt; (bool<a></a>):<br>
Expected a value of type ‘List[bool]’ for argument ‘l’ but instead found type ‘Dict[str, Tensor]’.</p>
<p>aten::_set_item(t<a></a> l, int idx, t(b) el) -&gt; (t<a></a>):<br>
Could not match type Dict[str, Tensor] to List[t] in argument ‘l’: Cannot match List[t] to Dict[str, Tensor].</p>
<p>aten::_set_item(Dict(str, t)(a) l, str idx, t(b) v) -&gt; ():<br>
Could not match type Tuple[Tensor, Tensor, Tensor, Tensor, Tensor] to t in argument ‘v’: Type variable ‘t’ previously matched to type Tensor is matched to type Tuple[Tensor, Tensor, Tensor, Tensor, Tensor].</p>
<p>aten::_set_item(Dict(int, t)(a) l, int idx, t(b) v) -&gt; ():<br>
Expected a value of type ‘Dict[int, t]’ for argument ‘l’ but instead found type ‘Dict[str, Tensor]’.</p>
<p>aten::_set_item(Dict(float, t)(a) l, float idx, t(b) v) -&gt; ():<br>
Expected a value of type ‘Dict[float, t]’ for argument ‘l’ but instead found type ‘Dict[str, Tensor]’.</p>
<p>The original call is:<br>
at /home/liangdao/.local/lib/python3.6/site-packages/spconv/conv.py:320:13<br>
self.output_padding,<br>
self.subm,<br>
self.transposed,<br>
use_hash=self.use_hash)</p>
<pre><code>        outids = temp__[0]
        indice_pairs = temp__[1]
        indice_pair_num = temp__[2]
        
        indice_dict[self.indice_key] = (outids, indices,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...  &lt;--- HERE
                                                indice_pairs,
                                                indice_pair_num,
                                                spatial_shape)
        print(indice_dict[self.indice_key])
                                   
    if self.fused_bn:
        assert self.bias is not None
        out_features = ops.fused_indice_conv(
            features, self.weight, self.bias, indice_pairs.to(device),'__module__.__torch__.torchplus.tools.DefaultArgLayer.forward' is being compiled since it was called from '__module__.__torch__.models.middle.SpMiddleFHD.forward'
</code></pre>
<p>at /home/liangdao/second.pytorch/impl_DL/py_cxx_integration/py_scripts/sample_model/models/middle.py:119:9<br>
def forward(self, voxel_features, coors):<br>
# coors[:, 1] += 1</p>
<pre><code>    coors = coors.int()
    ret = spconv.SparseConvTensor(voxel_features, coors,self.sparse_shape,self.batch_size)
    #print(self.time_process)
    ret = self.SubMConv3d_0(ret,ret.spatial_shape,ret.indice_dict,self.time_process,ret.indices)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &lt;--- HERE
    ret.features = F.relu(self.BatchNorm1d_16(ret.features))
    self.time_process += 1
    #print(self.time_process)
    ret = self.SubMConv3d_00(ret,ret.spatial_shape,ret.indice_dict,self.time_process,ret.indices)
    ret.features = F.relu(self.BatchNorm1d_16(ret.features))
    self.time_process += 1
    #print(self.time_process)
    ret = self.SpConv3d_0(ret,ret.spatial_shape,ret.indice_dict,self.time_process,ret.indices)
    ret.features = F.relu(self.BatchNorm1d_32(ret.features))
</code></pre>
<p>can somebody help me to solve this issue?</p>