<?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[RuntimeError: expected scalar type Long but found Float]]></title><description><![CDATA[<p>Anyone hit this question?</p>
<pre><code>frame #37: __libc_start_main + 0xd5 (0x7f6b88f11565 in /lib/x86_64-linux-gnu/libc.so.6)
 (function ComputeConstantFolding)
[W shape_type_inference.cpp:419] Warning: Constant folding in symbolic shape inference fails: expected scalar type Long but found Float
Exception raised from data_ptr&lt;long int&gt; at aten/src/ATen/core/TensorMethods.cpp:5759 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x42 (0x7f6acc30aa22 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::string const&amp;) + 0x5b (0x7f6acc3073db in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #2: long* at::Tensor::data_ptr&lt;long&gt;() const + 0xde (0x7f6ace4511fe in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #3: torch::jit::onnx_constant_fold::runTorchSlice_opset10(torch::jit::Node const*, std::vector&lt;at::Tensor, std::allocator&lt;at::Tensor&gt; &gt;&amp;) + 0x42e (0x7f6b7118d63e in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #4: torch::jit::onnx_constant_fold::runTorchBackendForOnnx(torch::jit::Node const*, std::vector&lt;at::Tensor, std::allocator&lt;at::Tensor&gt; &gt;&amp;, int) + 0x1c5 (0x7f6b7118e985 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #5: &lt;unknown function&gt; + 0xaed38e (0x7f6b711cd38e in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #6: torch::jit::ONNXShapeTypeInference(torch::jit::Node*, std::map&lt;std::string, c10::IValue, std::less&lt;std::string&gt;, std::allocator&lt;std::pair&lt;std::string const, c10::IValue&gt; &gt; &gt; const&amp;, int) + 0x906 (0x7f6b711d2146 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #7: &lt;unknown function&gt; + 0xaf4df4 (0x7f6b711d4df4 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #8: &lt;unknown function&gt; + 0xa71010 (0x7f6b71151010 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #9: &lt;unknown function&gt; + 0x5015fe (0x7f6b70be15fe in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
&lt;omitting python frames&gt;
frame #37: __libc_start_main + 0xd5 (0x7f6b88f11565 in /lib/x86_64-linux-gnu/libc.so.6)
 (function ComputeConstantFolding)
Traceback (most recent call last):
  File &quot;export_onnx.py&quot;, line 261, in &lt;module&gt;
    torch.onnx.export(model, inp, onnx_f, output_names={
  File &quot;/home/jintian/anaconda3/lib/python3.8/site-packages/torch/onnx/__init__.py&quot;, line 275, in export
    return utils.export(model, args, f, export_params, verbose, training,
  File &quot;/home/jintian/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 88, in export
    _export(model, args, f, export_params, verbose, training, input_names, output_names,
  File &quot;/home/jintian/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 689, in _export
    _model_to_graph(model, args, verbose, input_names,
  File &quot;/home/jintian/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 501, in _model_to_graph
    params_dict = torch._C._jit_pass_onnx_constant_fold(graph, params_dict,
RuntimeError: expected scalar type Long but found Float

</code></pre>
]]></description><link>http://t.manaai.cn/topic/377/runtimeerror-expected-scalar-type-long-but-found-float</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 00:13:33 GMT</lastBuildDate><atom:link href="http://t.manaai.cn/topic/377.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Oct 2021 15:27:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to RuntimeError: expected scalar type Long but found Float on Mon, 11 Oct 2021 15:27:05 GMT]]></title><description><![CDATA[<p>Anyone hit this question?</p>
<pre><code>frame #37: __libc_start_main + 0xd5 (0x7f6b88f11565 in /lib/x86_64-linux-gnu/libc.so.6)
 (function ComputeConstantFolding)
[W shape_type_inference.cpp:419] Warning: Constant folding in symbolic shape inference fails: expected scalar type Long but found Float
Exception raised from data_ptr&lt;long int&gt; at aten/src/ATen/core/TensorMethods.cpp:5759 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x42 (0x7f6acc30aa22 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::string const&amp;) + 0x5b (0x7f6acc3073db in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libc10.so)
frame #2: long* at::Tensor::data_ptr&lt;long&gt;() const + 0xde (0x7f6ace4511fe in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)
frame #3: torch::jit::onnx_constant_fold::runTorchSlice_opset10(torch::jit::Node const*, std::vector&lt;at::Tensor, std::allocator&lt;at::Tensor&gt; &gt;&amp;) + 0x42e (0x7f6b7118d63e in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #4: torch::jit::onnx_constant_fold::runTorchBackendForOnnx(torch::jit::Node const*, std::vector&lt;at::Tensor, std::allocator&lt;at::Tensor&gt; &gt;&amp;, int) + 0x1c5 (0x7f6b7118e985 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #5: &lt;unknown function&gt; + 0xaed38e (0x7f6b711cd38e in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #6: torch::jit::ONNXShapeTypeInference(torch::jit::Node*, std::map&lt;std::string, c10::IValue, std::less&lt;std::string&gt;, std::allocator&lt;std::pair&lt;std::string const, c10::IValue&gt; &gt; &gt; const&amp;, int) + 0x906 (0x7f6b711d2146 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #7: &lt;unknown function&gt; + 0xaf4df4 (0x7f6b711d4df4 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #8: &lt;unknown function&gt; + 0xa71010 (0x7f6b71151010 in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
frame #9: &lt;unknown function&gt; + 0x5015fe (0x7f6b70be15fe in /home/jintian/anaconda3/lib/python3.8/site-packages/torch/lib/libtorch_python.so)
&lt;omitting python frames&gt;
frame #37: __libc_start_main + 0xd5 (0x7f6b88f11565 in /lib/x86_64-linux-gnu/libc.so.6)
 (function ComputeConstantFolding)
Traceback (most recent call last):
  File &quot;export_onnx.py&quot;, line 261, in &lt;module&gt;
    torch.onnx.export(model, inp, onnx_f, output_names={
  File &quot;/home/jintian/anaconda3/lib/python3.8/site-packages/torch/onnx/__init__.py&quot;, line 275, in export
    return utils.export(model, args, f, export_params, verbose, training,
  File &quot;/home/jintian/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 88, in export
    _export(model, args, f, export_params, verbose, training, input_names, output_names,
  File &quot;/home/jintian/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 689, in _export
    _model_to_graph(model, args, verbose, input_names,
  File &quot;/home/jintian/anaconda3/lib/python3.8/site-packages/torch/onnx/utils.py&quot;, line 501, in _model_to_graph
    params_dict = torch._C._jit_pass_onnx_constant_fold(graph, params_dict,
RuntimeError: expected scalar type Long but found Float

</code></pre>
]]></description><link>http://t.manaai.cn/post/925</link><guid isPermaLink="true">http://t.manaai.cn/post/925</guid><dc:creator><![CDATA[刘看山]]></dc:creator><pubDate>Mon, 11 Oct 2021 15:27:05 GMT</pubDate></item></channel></rss>