Libtorch c++ error report when set image onto cuda and load .pt file

username: savior
cooked: <p>1.If the input image to be set on the cuda is a bit big , it will report the error ‘segmentation fault(core dump)’.<br>
I try to resize the image to 100x100x3 , it won’t report the error . If I resize the image to 512x512x3 , it will report the error .</p>
<p>2.When import the .pt file generated by torchscript in python, it will report the following error :<br>
terminate called after throwing an instance of ‘c10::Error’<br>
what():  c &gt;= ‘0’ &amp;&amp; c &lt;= ‘z’ ASSERT FAILED at /pytorch/torch/csrc/jit/pickler.cpp:487, please report a bug to PyTorch. (readString at /pytorch/torch/csrc/jit/pickler.cpp:487)<br>
frame <span class="hashtag">#0:</span> std::function&lt;std::string ()&gt;::operator()() const + 0x11 (0x7f1be414dbf1 in /media/usr515/ed65d8df-d015-4269-90bc-ac3cccb109a8/dsq/libtorch/libtorch/lib/libc10.so)<br>
frame <span class="hashtag">#1:</span> c10::Error::Error(c10::SourceLocation, std::string const&amp;) + 0x2a (0x7f1be414d52a in /media/usr515/ed65d8df-d015-4269-90bc-ac3cccb109a8/dsq/libtorch/libtorch/lib/libc10.so)<br>
frame <span class="hashtag">#2:</span> torch::jit::Unpickler::readString() + 0x138 (0x7f1be4befaf8 in /media/usr515/ed65d8df-d015-4269-90bc-ac3cccb109a8/dsq/libtorch/libtorch/lib/libtorch.so.1)<br>
frame <span class="hashtag">#3:</span> torch::jit::Unpickler::readInstruction() + 0x5c6 (0x7f1be4bf1366 in /media/usr515/ed65d8df-d015-4269-90bc-ac3cccb109a8/dsq/libtorch/libtorch/lib/libtorch.so.1)<br>
frame <span class="hashtag">#4:</span> torch::jit::Unpickler::run() + 0x55 (0x7f1be4bf2225 in /media/usr515/ed65d8df-d015-4269-90bc-ac3cccb109a8/dsq/libtorch/libtorch/lib/libtorch.so.1)<br>
frame <span class="hashtag">#5:</span> torch::jit::Unpickler::parse_ivalue_list() + 0x1e (0x7f1be4bf259e in /media/usr515/ed65d8df-d015-4269-90bc-ac3cccb109a8/dsq/libtorch/libtorch/lib/libtorch.so.1)<br>
frame <span class="hashtag">#6:</span>  + 0x9dcc45 (0x7f1be4d43c45 in /media/usr515/ed65d8df-d015-4269-90bc-ac3cccb109a8/dsq/libtorch/libtorch/lib/libtorch.so.1)<br>
frame <span class="hashtag">#7:</span> torch::jit::load(std::unique_ptr&lt;caffe2::serialize::ReadAdapterInterface, std::default_delete<a>caffe2::serialize::ReadAdapterInterface</a> &gt;, c10::optional<a>c10::Device</a>, std::unordered_map&lt;std::string, std::string, std::hash<a>std::string</a>, std::equal_to<a>std::string</a>, std::allocator&lt;std::pair&lt;std::string const, std::string&gt; &gt; &gt;&amp;) + 0x10d (0x7f1be4d4549d in /media/usr515/ed65d8df-d015-4269-90bc-ac3cccb109a8/dsq/libtorch/libtorch/lib/libtorch.so.1)<br>
frame <span class="hashtag">#8:</span> torch::jit::load(std::string const&amp;, c10::optional<a>c10::Device</a>, std::unordered_map&lt;std::string, std::string, std::hash<a>std::string</a>, std::equal_to<a>std::string</a>, std::allocator&lt;std::pair&lt;std::string const, std::string&gt; &gt; &gt;&amp;) + 0x68 (0x7f1be4d455c8 in /media/usr515/ed65d8df-d015-4269-90bc-ac3cccb109a8/dsq/libtorch/libtorch/lib/libtorch.so.1)<br>
frame <span class="hashtag">#9:</span> main + 0x6b7 (0x41f4c6 in ./demo)<br>
frame <span class="hashtag">#10:</span> __libc_start_main + 0xf0 (0x7f1b9da8d830 in /lib/x86_64-linux-gnu/libc.so.6)<br>
frame <span class="hashtag">#11:</span> _start + 0x29 (0x41dfe9 in ./demo)</p>
<p>environment:<br>
pytorch 1.1.0<br>
cuda 10.0<br>
libtorch 1.1.0<br>
gpu RTX-TITAN x2<br>
ubuntu 16.04</p>

username: tom
cooked: <p>You would likely need to add some more information about what you are doing to get help.<br>
Also, it might help to see if the same error happens in libtorch 1.2, just to grab all the improvements in between.</p>
<p>Best regards</p>
<p>Thomas</p>