<?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_d2训练的resnet_101的模型，转onnx的时候报错。]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://t.manaai.cn/uid/5">@刘看山</a><br />
神力的例程用的是resnet 50，我改称101了，也可以正常训练，但是在用export.py转出模型的时候报错了：<br />
/home/jim/project/wood/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/project/wood/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/project/wood/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/project/wood/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/project/wood/solov2_d2/adet/modeling/solov2/solov2.py:678: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.<br />
if len(sort_inds) &gt; self.max_before_nms:<br />
/home/jim/project/wood/solov2_d2/adet/modeling/solov2/utils.py:161: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.<br />
n_samples = len(cate_labels)<br />
/home/jim/project/wood/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/project/wood/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/project/wood/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/project/wood/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 275, 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 689, 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 200, 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 313, 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 990, 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 944, 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<br />
请帮我看一下，多谢</p>
]]></description><link>http://t.manaai.cn/topic/368/用神力的solov2_d2训练的resnet_101的模型-转onnx的时候报错</link><generator>RSS for Node</generator><lastBuildDate>Wed, 12 Aug 2026 20:17:30 GMT</lastBuildDate><atom:link href="http://t.manaai.cn/topic/368.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 14 Aug 2021 09:16:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to 用神力的Solov2_d2训练的resnet_101的模型，转onnx的时候报错。 on Sat, 14 Aug 2021 09:16:50 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://t.manaai.cn/uid/5">@刘看山</a><br />
神力的例程用的是resnet 50，我改称101了，也可以正常训练，但是在用export.py转出模型的时候报错了：<br />
/home/jim/project/wood/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/project/wood/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/project/wood/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/project/wood/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/project/wood/solov2_d2/adet/modeling/solov2/solov2.py:678: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.<br />
if len(sort_inds) &gt; self.max_before_nms:<br />
/home/jim/project/wood/solov2_d2/adet/modeling/solov2/utils.py:161: TracerWarning: Using len to get tensor shape might cause the trace to be incorrect. Recommended usage would be tensor.shape[0]. Passing a tensor of different shape might lead to errors or silently give incorrect results.<br />
n_samples = len(cate_labels)<br />
/home/jim/project/wood/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/project/wood/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/project/wood/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/project/wood/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 275, 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 689, 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 200, 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 313, 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 990, 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 944, 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<br />
请帮我看一下，多谢</p>
]]></description><link>http://t.manaai.cn/post/896</link><guid isPermaLink="true">http://t.manaai.cn/post/896</guid><dc:creator><![CDATA[JimXu1989]]></dc:creator><pubDate>Sat, 14 Aug 2021 09:16:50 GMT</pubDate></item><item><title><![CDATA[Reply to 用神力的Solov2_d2训练的resnet_101的模型，转onnx的时候报错。 on Fri, 03 Sep 2021 09:30:59 GMT]]></title><description><![CDATA[<p>你对照下res50看看哪个地方没有对齐，因为我们也没有试过101，理论上应该是一样的才对</p>
]]></description><link>http://t.manaai.cn/post/914</link><guid isPermaLink="true">http://t.manaai.cn/post/914</guid><dc:creator><![CDATA[刘看山]]></dc:creator><pubDate>Fri, 03 Sep 2021 09:30:59 GMT</pubDate></item></channel></rss>