<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[SOLOv2转ONNX教程]]></title><description><![CDATA[<p>下载神力平台的solov2代码：</p>
<p><a href="https://manaai.cn" target="_blank" rel="noopener noreferrer nofollow">https://manaai.cn</a></p>
<p>然后切换到　solov2 分支．<br />
就可以运行这行命令实现转换：</p>
<pre><code>python3 demo/export_onnx.py \
    --config-file configs/SOLOv2/coco/R50_lite_3x.yaml \
    --video-input 0.mp4 \
    --opts MODEL.WEIGHTS ./output/model_final.pth

</code></pre>
<p>请注意，实现记得下载好你的final.pth．　其次记得将不要修改代码，因为正常下是没有问题的：<br />
<img src="/assets/uploads/files/1624002817823-3c302be8-3591-4c5e-970e-251c22b11591-image.png" alt="3c302be8-3591-4c5e-970e-251c22b11591-image.png" class="img-responsive img-markdown" /></p>
<p>最后我们的环境是：</p>
<pre><code>torch                         1.7.1                     

</code></pre>
<p>当然更高版本应该问题不大．</p>
<p>进一步的，你转好了onnx之后，还可以将模型转成trt的文件进行trt的推理．</p>
]]></description><link>http://t.manaai.cn/topic/350/solov2转onnx教程</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 12:27:35 GMT</lastBuildDate><atom:link href="http://t.manaai.cn/topic/350.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 Jun 2021 07:54:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Fri, 18 Jun 2021 07:54:53 GMT]]></title><description><![CDATA[<p>下载神力平台的solov2代码：</p>
<p><a href="https://manaai.cn" target="_blank" rel="noopener noreferrer nofollow">https://manaai.cn</a></p>
<p>然后切换到　solov2 分支．<br />
就可以运行这行命令实现转换：</p>
<pre><code>python3 demo/export_onnx.py \
    --config-file configs/SOLOv2/coco/R50_lite_3x.yaml \
    --video-input 0.mp4 \
    --opts MODEL.WEIGHTS ./output/model_final.pth

</code></pre>
<p>请注意，实现记得下载好你的final.pth．　其次记得将不要修改代码，因为正常下是没有问题的：<br />
<img src="/assets/uploads/files/1624002817823-3c302be8-3591-4c5e-970e-251c22b11591-image.png" alt="3c302be8-3591-4c5e-970e-251c22b11591-image.png" class="img-responsive img-markdown" /></p>
<p>最后我们的环境是：</p>
<pre><code>torch                         1.7.1                     

</code></pre>
<p>当然更高版本应该问题不大．</p>
<p>进一步的，你转好了onnx之后，还可以将模型转成trt的文件进行trt的推理．</p>
]]></description><link>http://t.manaai.cn/post/850</link><guid isPermaLink="true">http://t.manaai.cn/post/850</guid><dc:creator><![CDATA[刘看山]]></dc:creator><pubDate>Fri, 18 Jun 2021 07:54:53 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Fri, 18 Jun 2021 08:21:30 GMT]]></title><description><![CDATA[<p>实测torch1.6版本导出ONNX会出错,torch升级到1.7就可以了.非常感谢!<img
      src="http://t.manaai.cn/plugins/nodebb-plugin-emoji/emoji/android/1f44d.png?v=20ittarjfjb"
      class="not-responsive emoji emoji-android emoji--+1"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>http://t.manaai.cn/post/851</link><guid isPermaLink="true">http://t.manaai.cn/post/851</guid><dc:creator><![CDATA[boboY]]></dc:creator><pubDate>Fri, 18 Jun 2021 08:21:30 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Thu, 24 Jun 2021 08:26:39 GMT]]></title><description><![CDATA[<p>Hi<br />
在solov2_d2下面没有找到export_onnx.py，<a href="http://xn--export-295jh77j.py" target="_blank" rel="noopener noreferrer nofollow">只有export.py</a>，而且运行之后报了这样一个错：</p>
<p>jim@jim-AERO-15-X9:~/solov2_d2$ python3 demo/export.py  --config-file configs/SOLOv2/R101_3x.yaml  --video-input 0.mp4  --opts MODEL.WEIGHTS ./output/model_final.pth<br />
[06/24 16:24:40 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='configs/SOLOv2/R101_3x.yaml', input=None, opts=['MODEL.WEIGHTS', './output/model_final.pth'], output=None, video_input='0.mp4', webcam=False)<br />
[06/24 16:24:44 fvcore.common.checkpoint]: [Checkpointer] Loading from ./output/model_final.pth ...<br />
[06/24 16:24:45 fvcore.common.checkpoint]: [Checkpointer] Loading from ./output/model_final.pth ...<br />
/home/jim/.local/lib/python3.8/site-packages/torch/tensor.py:587: RuntimeWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).<br />
warnings.warn('Iterating over a tensor might cause the trace to be incorrect. '<br />
Traceback (most recent call last):<br />
File &quot;demo/export.py&quot;, line 153, in <module><br />
torch.onnx.export(model, inp, 'solov2.onnx', output_names={<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/<strong>init</strong>.py&quot;, line 271, in export<br />
return utils.export(model, args, f, export_params, verbose, training,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 88, in export<br />
_export(model, args, f, export_params, verbose, training, input_names, output_names,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 694, in _export<br />
_model_to_graph(model, args, verbose, input_names,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 457, in _model_to_graph<br />
graph, params, torch_out, module = _create_jit_graph(model, args,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 420, in _create_jit_graph<br />
graph, torch_out = _trace_and_get_graph_from_model(model, args)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 380, in _trace_and_get_graph_from_model<br />
torch.jit._get_trace_graph(model, args, strict=False, _force_outplace=False, _return_inputs_states=True)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/jit/_trace.py&quot;, line 1139, in _get_trace_graph<br />
outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/nn/modules/module.py&quot;, line 889, in _call_impl<br />
result = self.forward(*input, **kwargs)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/jit/_trace.py&quot;, line 125, in forward<br />
graph, out = torch._C._create_graph_by_tracing(<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/jit/_trace.py&quot;, line 116, in wrapper<br />
outs.append(self.inner(*trace_inputs))<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/nn/modules/module.py&quot;, line 887, in _call_impl<br />
result = self._slow_forward(*input, **kwargs)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/nn/modules/module.py&quot;, line 860, in _slow_forward<br />
result = self.forward(*input, **kwargs)<br />
File &quot;/home/jim/AdelaiDet/adet/modeling/solov2/solov2.py&quot;, line 108, in forward<br />
images = self.preprocess_image(batched_inputs)<br />
File &quot;/home/jim/AdelaiDet/adet/modeling/solov2/solov2.py&quot;, line 152, in preprocess_image<br />
images = [x[&quot;image&quot;].to(self.device) for x in batched_inputs]<br />
File &quot;/home/jim/AdelaiDet/adet/modeling/solov2/solov2.py&quot;, line 152, in <listcomp><br />
images = [x[&quot;image&quot;].to(self.device) for x in batched_inputs]<br />
IndexError: too many indices for tensor of dimension 3</p>
]]></description><link>http://t.manaai.cn/post/866</link><guid isPermaLink="true">http://t.manaai.cn/post/866</guid><dc:creator><![CDATA[JimXu1989]]></dc:creator><pubDate>Thu, 24 Jun 2021 08:26:39 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Thu, 24 Jun 2021 08:39:03 GMT]]></title><description><![CDATA[<p>我的torch版本是'1.8.1+cu111'</p>
]]></description><link>http://t.manaai.cn/post/867</link><guid isPermaLink="true">http://t.manaai.cn/post/867</guid><dc:creator><![CDATA[JimXu1989]]></dc:creator><pubDate>Thu, 24 Jun 2021 08:39:03 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Thu, 24 Jun 2021 08:40:12 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://t.manaai.cn/uid/894">@JimXu1989</a> 在 <a href="/post/866">SOLOv2转ONNX教程</a> 中说：</p>
<blockquote>
<p>Hi<br />
在solov2_d2下面没有找到export_onnx.py，<a href="http://xn--export-295jh77j.py" target="_blank" rel="noopener noreferrer nofollow">只有export.py</a>，而且运行之后报了这样一个错：<br />
jim@jim-AERO-15-X9:~/solov2_d2$ python3 demo/export.py  --config-file configs/SOLOv2/R101_3x.yaml  --video-input 0.mp4  --opts MODEL.WEIGHTS ./output/model_final.pth<br />
[06/24 16:24:40 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='configs/SOLOv2/R101_3x.yaml', input=None, opts=['MODEL.WEIGHTS', './output/model_final.pth'], output=None, video_input='0.mp4', webcam=False)<br />
[06/24 16:24:44 fvcore.common.checkpoint]: [Checkpointer] Loading from ./output/model_final.pth ...<br />
[06/24 16:24:45 fvcore.common.checkpoint]: [Checkpointer] Loading from ./output/model_final.pth ...<br />
/home/jim/.local/lib/python3.8/site-packages/torch/tensor.py:587: RuntimeWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).<br />
warnings.warn('Iterating over a tensor might cause the trace to be incorrect. '<br />
Traceback (most recent call last):<br />
File &quot;demo/export.py&quot;, line 153, in<br />
torch.onnx.export(model, inp, 'solov2.onnx', output_names={<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/init.py&quot;, line 271, in export<br />
return utils.export(model, args, f, export_params, verbose, training,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 88, in export<br />
_export(model, args, f, export_params, verbose, training, input_names, output_names,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 694, in _export<br />
_model_to_graph(model, args, verbose, input_names,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 457, in _model_to_graph<br />
graph, params, torch_out, module = _create_jit_graph(model, args,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 420, in _create_jit_graph<br />
graph, torch_out = _trace_and_get_graph_from_model(model, args)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 380, in _trace_and_get_graph_from_model<br />
torch.jit._get_trace_graph(model, args, strict=False, _force_outplace=False, _return_inputs_states=True)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/jit/_trace.py&quot;, line 1139, in _get_trace_graph<br />
outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/nn/modules/module.py&quot;, line 889, in _call_impl<br />
result = self.forward(*input, **kwargs)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/jit/_trace.py&quot;, line 125, in forward<br />
graph, out = torch._C._create_graph_by_tracing(<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/jit/_trace.py&quot;, line 116, in wrapper<br />
outs.append(self.inner(*trace_inputs))<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/nn/modules/module.py&quot;, line 887, in _call_impl<br />
result = self._slow_forward(*input, **kwargs)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/nn/modules/module.py&quot;, line 860, in _slow_forward<br />
result = self.forward(*input, **kwargs)<br />
File &quot;/home/jim/AdelaiDet/adet/modeling/solov2/solov2.py&quot;, line 108, in forward<br />
images = self.preprocess_image(batched_inputs)<br />
File &quot;/home/jim/AdelaiDet/adet/modeling/solov2/solov2.py&quot;, line 152, in preprocess_image<br />
images = [x[&quot;image&quot;].to(self.device) for x in batched_inputs]<br />
File &quot;/home/jim/AdelaiDet/adet/modeling/solov2/solov2.py&quot;, line 152, in<br />
images = [x[&quot;image&quot;].to(self.device) for x in batched_inputs]<br />
IndexError: too many indices for tensor of dimension 3</p>
</blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="http://t.manaai.cn/uid/5">@刘看山</a></p>
]]></description><link>http://t.manaai.cn/post/868</link><guid isPermaLink="true">http://t.manaai.cn/post/868</guid><dc:creator><![CDATA[JimXu1989]]></dc:creator><pubDate>Thu, 24 Jun 2021 08:40:12 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Thu, 24 Jun 2021 08:41:17 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://t.manaai.cn/uid/894">@JimXu1989</a></p>
<p>请安装我们的adet．你如果系统有其他版本就卸载．我们的版本和其他版本不一样，再次声明，我们的代码都是经过修改过的版权代码，其他地方拷贝的代码报的错，不要与我们的教程混淆，请另外发帖．</p>
]]></description><link>http://t.manaai.cn/post/869</link><guid isPermaLink="true">http://t.manaai.cn/post/869</guid><dc:creator><![CDATA[刘看山]]></dc:creator><pubDate>Thu, 24 Jun 2021 08:41:17 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Thu, 24 Jun 2021 08:50:57 GMT]]></title><description><![CDATA[<p>用pytorch运行又报了一个不一样的错@刘看山</p>
<p>/usr/bin/python3.8 /home/jim/solov2_d2/demo/export.py --config-file ../configs/SOLOv2/R101_3x.yaml --video-input ../0.mp4 --opts MODEL.WEIGHTS ../output/model_final.pth<br />
[06/24 16:49:06 detectron2]: Arguments: Namespace(confidence_threshold=0.5, config_file='../configs/SOLOv2/R101_3x.yaml', input=None, opts=['MODEL.WEIGHTS', '../output/model_final.pth'], output=None, video_input='../0.mp4', webcam=False)<br />
INFO 06.24 16:49:07 <a href="http://solov2.py:78" target="_blank" rel="noopener noreferrer nofollow">solov2.py:78</a>: instance_shapes: [ShapeSpec(channels=256, height=None, width=None, stride=4), ShapeSpec(channels=256, height=None, width=None, stride=8), ShapeSpec(channels=256, height=None, width=None, stride=16), ShapeSpec(channels=256, height=None, width=None, stride=32), ShapeSpec(channels=256, height=None, width=None, stride=64)]<br />
[06/24 16:49:15 fvcore.common.checkpoint]: [Checkpointer] Loading from ../output/model_final.pth ...<br />
INFO 06.24 16:49:17 <a href="http://solov2.py:78" target="_blank" rel="noopener noreferrer nofollow">solov2.py:78</a>: instance_shapes: [ShapeSpec(channels=256, height=None, width=None, stride=4), ShapeSpec(channels=256, height=None, width=None, stride=8), ShapeSpec(channels=256, height=None, width=None, stride=16), ShapeSpec(channels=256, height=None, width=None, stride=32), ShapeSpec(channels=256, height=None, width=None, stride=64)]<br />
[06/24 16:49:18 fvcore.common.checkpoint]: [Checkpointer] Loading from ../output/model_final.pth ...<br />
[WARN] exporting onnx...<br />
batched_inputs:  torch.Size([1, 3, 704, 736])<br />
/home/jim/.local/lib/python3.8/site-packages/torch/nn/functional.py:3454: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.<br />
warnings.warn(<br />
/home/jim/.local/lib/python3.8/site-packages/torch/nn/functional.py:3502: UserWarning: The default behavior for interpolate/upsample with float scale_factor changed in 1.6.0 to align with other frameworks/libraries, and now uses scale_factor directly, instead of relying on the computed output size. If you wish to restore the old behavior, please set recompute_scale_factor=True. See the documentation of nn.Upsample for details.<br />
warnings.warn(<br />
pred_masks /home/jim/.local/lib/python3.8/site-packages/torch/tensor.py:587: RuntimeWarning: Iterating over a tensor might cause the trace to be incorrect. Passing a tensor of different shape won't change the number of iterations executed (and might lead to errors or silently give incorrect results).<br />
warnings.warn('Iterating over a tensor might cause the trace to be incorrect. '<br />
tensor(&lsqb;&lsqb;&lsqb;&lsqb;0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 3.9518e+00,<br />
3.7653e+00, 3.8083e+00],<br />
[0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 4.5552e+00,<br />
4.3284e+00, 4.1046e+00],<br />
[0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 4.7800e+00,<br />
4.6571e+00, 4.3812e+00],<br />
...,<br />
[1.1723e-01, 1.5662e-01, 1.9572e-01,  ..., 1.9446e-01,<br />
1.1960e-01, 5.0942e-02],<br />
[1.0176e-01, 1.4805e-01, 1.7128e-01,  ..., 1.8052e-01,<br />
1.1186e-01, 5.3612e-02],<br />
[9.6826e-02, 9.2554e-02, 9.1506e-02,  ..., 9.5873e-02,<br />
6.4562e-02, 5.5044e-02&rsqb;&rsqb;,</p>
<pre><code>     &lsqb;&lsqb;0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      ...,
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 3.7478e-02,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 4.8736e-02,
       7.6189e-03, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 7.7488e-02,
       5.2618e-02, 2.4377e-02&rsqb;&rsqb;,

     &lsqb;&lsqb;0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      ...,
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00&rsqb;&rsqb;,

     ...,

     &lsqb;&lsqb;0.0000e+00, 0.0000e+00, 2.5016e-02,  ..., 2.8171e+01,
       2.9437e+01, 2.7834e+01],
      [0.0000e+00, 4.3195e-02, 8.7966e-02,  ..., 2.8479e+01,
       3.1145e+01, 3.0990e+01],
      [0.0000e+00, 5.1823e-02, 8.0432e-02,  ..., 2.8781e+01,
       3.2091e+01, 3.2862e+01],
      ...,
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 1.4385e-01,
       1.4950e-01, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 5.5557e-02,
       8.0213e-02, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00&rsqb;&rsqb;,

     &lsqb;&lsqb;0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 2.4763e-02, 6.4760e-02,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 4.8006e-02, 4.6316e-02,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      ...,
      [8.3648e-03, 5.4830e-02, 1.3018e-01,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 7.6539e-03, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00&rsqb;&rsqb;,

     &lsqb;&lsqb;4.6343e-02, 1.1665e-01, 1.7521e-01,  ..., 3.3670e+01,
       3.3471e+01, 2.9798e+01],
      [7.0594e-02, 1.5725e-01, 2.2316e-01,  ..., 3.2300e+01,
       3.3655e+01, 3.1853e+01],
      [8.3667e-02, 1.7335e-01, 2.1356e-01,  ..., 3.2309e+01,
       3.4434e+01, 3.3425e+01],
      ...,
      [0.0000e+00, 1.1504e-02, 3.4751e-02,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00],
      [0.0000e+00, 0.0000e+00, 0.0000e+00,  ..., 0.0000e+00,
       0.0000e+00, 0.0000e+00&rsqb;&rsqb;&rsqb;&rsqb;, device='cuda:0') torch.Size([1, 256, 176, 184])
</code></pre>
<p>tensor(False, device='cuda:0')<br />
tensor(False, device='cuda:0')<br />
pred cate:  torch.Size([3872, 80])<br />
pred kernel:  torch.Size([3872, 256])<br />
/home/jim/solov2_d2/adet/modeling/solov2/solov2.py:628: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!<br />
assert not torch.isnan(seg_preds).any(), 'seg_preds contains nan'<br />
/home/jim/solov2_d2/adet/modeling/solov2/solov2.py:656: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.<br />
sh = torch.tensor(seg_preds.shape)<br />
/home/jim/solov2_d2/adet/modeling/solov2/solov2.py:658: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.<br />
sh_kernel = torch.tensor(kernel_preds.shape)<br />
/home/jim/solov2_d2/adet/modeling/solov2/solov2.py:666: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.<br />
seg_masks = seg_preds &gt; torch.tensor(self.mask_threshold).float()<br />
/home/jim/solov2_d2/adet/modeling/solov2/solov2.py:689: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.<br />
keep = cate_scores &gt;= torch.tensor(<br />
/home/jim/solov2_d2/adet/modeling/solov2/solov2.py:745: TracerWarning: Converting a tensor to a Python integer might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs!<br />
size=(max(int(ori_h<em>0.6), 736), max(int(ori_w</em>0.6), 992)),<br />
/home/jim/solov2_d2/adet/modeling/solov2/solov2.py:747: TracerWarning: torch.tensor results are registered as constants in the trace. You can safely ignore this warning if you use this function to create tensors out of constant variables that would be the same every time you call this function. In any other case, this might cause the trace to be incorrect.<br />
seg_masks = seg_masks &gt; torch.tensor(self.mask_threshold).float()<br />
Traceback (most recent call last):<br />
File &quot;/home/jim/solov2_d2/demo/export.py&quot;, line 153, in <module><br />
torch.onnx.export(model, inp, 'solov2.onnx', output_names={<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/<strong>init</strong>.py&quot;, line 271, in export<br />
return utils.export(model, args, f, export_params, verbose, training,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 88, in export<br />
_export(model, args, f, export_params, verbose, training, input_names, output_names,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 694, in _export<br />
_model_to_graph(model, args, verbose, input_names,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 463, in _model_to_graph<br />
graph = _optimize_graph(graph, operator_export_type,<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 206, in _optimize_graph<br />
graph = torch._C._jit_pass_onnx(graph, operator_export_type)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/<strong>init</strong>.py&quot;, line 309, in _run_symbolic_function<br />
return utils._run_symbolic_function(*args, **kwargs)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 993, in _run_symbolic_function<br />
symbolic_fn = _find_symbolic_in_registry(domain, op_name, opset_version, operator_export_type)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 950, in _find_symbolic_in_registry<br />
return sym_registry.get_registered_op(op_name, domain, opset_version)<br />
File &quot;/home/jim/.local/lib/python3.8/site-packages/torch/onnx/symbolic_registry.py&quot;, line 116, in get_registered_op<br />
raise RuntimeError(msg)<br />
RuntimeError: Exporting the operator linspace to ONNX opset version 11 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub.</p>
<p>Process finished with exit code 1</p>
]]></description><link>http://t.manaai.cn/post/870</link><guid isPermaLink="true">http://t.manaai.cn/post/870</guid><dc:creator><![CDATA[JimXu1989]]></dc:creator><pubDate>Thu, 24 Jun 2021 08:50:57 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Tue, 29 Jun 2021 13:38:44 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://t.manaai.cn/uid/894">@JimXu1989</a> 请和我们的版本保持一致，应该是pytorch版本的问题</p>
]]></description><link>http://t.manaai.cn/post/873</link><guid isPermaLink="true">http://t.manaai.cn/post/873</guid><dc:creator><![CDATA[刘看山]]></dc:creator><pubDate>Tue, 29 Jun 2021 13:38:44 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Tue, 27 Jul 2021 07:52:44 GMT]]></title><description><![CDATA[<p>tensorrt的代码有吗</p>
]]></description><link>http://t.manaai.cn/post/882</link><guid isPermaLink="true">http://t.manaai.cn/post/882</guid><dc:creator><![CDATA[gulian]]></dc:creator><pubDate>Tue, 27 Jul 2021 07:52:44 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Sat, 14 Aug 2021 09:39:56 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://t.manaai.cn/uid/5">@刘看山</a> 请问要怎么彻底卸载原版的solov2呀</p>
]]></description><link>http://t.manaai.cn/post/897</link><guid isPermaLink="true">http://t.manaai.cn/post/897</guid><dc:creator><![CDATA[JimXu1989]]></dc:creator><pubDate>Sat, 14 Aug 2021 09:39:56 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Wed, 22 Jun 2022 07:28:16 GMT]]></title><description><![CDATA[<p>final.pth下载地址？</p>
]]></description><link>http://t.manaai.cn/post/1152</link><guid isPermaLink="true">http://t.manaai.cn/post/1152</guid><dc:creator><![CDATA[jsjs0827]]></dc:creator><pubDate>Wed, 22 Jun 2022 07:28:16 GMT</pubDate></item><item><title><![CDATA[Reply to SOLOv2转ONNX教程 on Wed, 22 Jun 2022 07:35:39 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://t.manaai.cn/uid/5">@刘看山</a> final.pth在哪下载啊？</p>
]]></description><link>http://t.manaai.cn/post/1153</link><guid isPermaLink="true">http://t.manaai.cn/post/1153</guid><dc:creator><![CDATA[jsjs0827]]></dc:creator><pubDate>Wed, 22 Jun 2022 07:35:39 GMT</pubDate></item></channel></rss>