libtorch-yolov3 icon indicating copy to clipboard operation
libtorch-yolov3 copied to clipboard

load_weights error

Open mathpopo opened this issue 6 years ago • 2 comments

./yolo-app ../imgs/person.jpg loading weight ... terminate called after throwing an instance of 'c10::Error' what(): Tensor: invalid storage offset -5 (setStrided at /pytorch/aten/src/ATen/native/Resize.h:87) frame #0: std::function<std::string ()>::operator()() const + 0x11 (0x7f0957255441 in /home/chenxin/Desktop/libtorch-shared-with-deps-latest/libtorch/lib/libc10.so) frame #1: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x2a (0x7f0957254d7a in /home/chenxin/Desktop/libtorch-shared-with-deps-latest/libtorch/lib/libc10.so) frame #2: + 0xa36497 (0x7f094d20b497 in /home/chenxin/Desktop/libtorch-shared-with-deps-latest/libtorch/lib/libcaffe2.so) frame #3: at::native::as_strided_tensorimpl(at::Tensor const&, c10::ArrayRef, c10::ArrayRef, c10::optional) + 0xbb (0x7f094d2081eb in /home/chenxin/Desktop/libtorch-shared-with-deps-latest/libtorch/lib/libcaffe2.so) frame #4: + 0xb25b1a (0x7f094d2fab1a in /home/chenxin/Desktop/libtorch-shared-with-deps-latest/libtorch/lib/libcaffe2.so) frame #5: at::native::slice(at::Tensor const&, long, long, long, long) + 0x1b8 (0x7f094d2000f8 in /home/chenxin/Desktop/libtorch-shared-with-deps-latest/libtorch/lib/libcaffe2.so) frame #6: at::TypeDefault::slice(at::Tensor const&, long, long, long, long) const + 0x1a (0x7f094d45f1fa in /home/chenxin/Desktop/libtorch-shared-with-deps-latest/libtorch/lib/libcaffe2.so) frame #7: at::Tensor::slice(long, long, long, long) const + 0x6f (0x55b9b4eb4cf5 in ./yolo-app) frame #8: Darknet::load_weights(char const*) + 0x596 (0x55b9b4eadfee in ./yolo-app) frame #9: main + 0x1a1 (0x55b9b4eef14b in ./yolo-app) frame #10: __libc_start_main + 0xe7 (0x7f08d0fe5b97 in /lib/x86_64-linux-gnu/libc.so.6) frame #11: _start + 0x2a (0x55b9b4ea848a in ./yolo-app)

Aborted (core dumped)

mathpopo avatar Jul 17 '19 01:07 mathpopo

https://github.com/walktree/libtorch-yolov3/issues/12 https://github.com/walktree/libtorch-yolov3/issues/4

walktree avatar Jul 17 '19 01:07 walktree

I guess your weight file was in the wrong directory

put the weight file at models/ solve the problem.

reveriel avatar Nov 13 '19 14:11 reveriel