1

执行图像时出现错误(如下所示)。我使用 Python 来跟踪 Yolo 模型,而 C++ 环境中的跟踪文件只给出了一张图像的错误。我猜这个错误可能是由于图像没有任何对象检测。

**terminate called after throwing an instance of 'c10::Error'
  what():  dim() called on undefined Tensor (dim at ../c10/core/UndefinedTensorImpl.cpp:24)
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 0x6a (0x7f8e4ec3baaa in libtorch/lib/libc10.so)
frame #1: c10::UndefinedTensorImpl::dim() const + 0x258 (0x7f8e4ec33258 in libtorch/lib/libc10.so)
frame #2: at::native::size(at::Tensor const&, long) + 0x15 (0x7f8e408ca4a5 in libtorch/lib/libtorch_cpu.so)
frame #3: <unknown function> + 0x3464a (0x556c2485164a in ./Torchimport_YOLO3)
frame #4: <unknown function> + 0x2fb1b (0x556c2484cb1b in ./Torchimport_YOLO3)
frame #5: long c10::Dispatcher::callUnboxed<long, at::Tensor const&, long>(c10::OperatorHandle const&, at::Tensor const&, long) const + 0x8f (0x556c24847e41 in ./Torchimport_YOLO3)
frame #6: <unknown function> + 0x244f3 (0x556c248414f3 in ./Torchimport_YOLO3)
frame #7: at::Tensor::size(long) const + 0x83 (0x556c24837c13 in ./Torchimport_YOLO3)
frame #8: <unknown function> + 0xeef1 (0x556c2482bef1 in ./Torchimport_YOLO3)
frame #9: __libc_start_main + 0xe7 (0x7f8e01096b97 in /lib/x86_64-linux-gnu/libc.so.6)
frame #10: <unknown function> + 0xa65a (0x556c2482765a in ./Torchimport_YOLO3)**
4

0 回答 0