libtorch_cpp_mobilenetv2_5classes icon indicating copy to clipboard operation
libtorch_cpp_mobilenetv2_5classes copied to clipboard

c10::Error

Open GYE19970220 opened this issue 5 years ago • 2 comments

when I run your code,it report an error that terminate called after throwing an instance of 'c10::Error' what(): Must not create a new variable from a variable, use its .data().It seems like the problem happens on these two lines auto img_var = torch::autograd::make_variable(img_t[0],false); auto img_var1 = torch::autograd::make_variable(img_t[1],false);,Do you know how to solve it?

GYE19970220 avatar Feb 20 '20 14:02 GYE19970220

try to use an old libtorch version, this code is out of date now, sorry for that.

zacario-li avatar Apr 22 '20 15:04 zacario-li

when I run your code,it report an error that terminate called after throwing an instance of 'c10::Error' what(): Must not create a new variable from a variable, use its .data().It seems like the problem happens on these two lines auto img_var = torch::autograd::make_variable(img_t[0],false); auto img_var1 = torch::autograd::make_variable(img_t[1],false);,Do you know how to solve it?

I updated the code with libtorch1.7.1, try it.

zacario-li avatar Jan 04 '21 01:01 zacario-li