Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./libtorch-yolov5 error #4

Closed
name333 opened this issue Aug 3, 2020 · 3 comments
Closed

./libtorch-yolov5 error #4

name333 opened this issue Aug 3, 2020 · 3 comments

Comments

@name333
Copy link

name333 commented Aug 3, 2020

hi
Thank you for your work, when I run "./libtorch-yolov5 /data_1/train_project/OBJ_Detection/yolov5-forward/module/torchscript.pt /data_1/train_project/OBJ_Detection/yolov5-forward/img/000240_01046820200606110918_0035_670_3cls.jpg -gpu".
The following error occurred

terminate called after throwing an instance of 'c10::Error'
what(): isTuple() INTERNAL ASSERT FAILED at /data_1/train_project/OBJ_Detection/yolov5-forward/libtorch/include/ATen/core/ivalue_inl.h:723, please report a bug to PyTorch. Expected Tuple but got GenericList (toTuple at /data_1/train_project/OBJ_Detection/yolov5-forward/libtorch/include/ATen/core/ivalue_inl.h:723)
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) + 0x6a (0x7f7d00dfaaaa in /data_1/train_project/OBJ_Detection/yolov5-forward/libtorch/lib/libc10.so)
frame #1: c10::IValue::toTuple() const & + 0x121 (0x559bed24f2b3 in ./libtorch-yolov5)
frame #2: + 0xef9c (0x559bed245f9c in ./libtorch-yolov5)
frame #3: + 0x4176b (0x559bed27876b in ./libtorch-yolov5)
frame #4: __libc_start_main + 0xe7 (0x7f7cabd8eb97 in /lib/x86_64-linux-gnu/libc.so.6)
frame #5: + 0xcc6a (0x559bed243c6a in ./libtorch-yolov5)

how to solve this problem

@yasenh
Copy link
Owner

yasenh commented Aug 3, 2020

Hi @name333 , did you follow the instruction here https://github.com/yasenh/libtorch-yolov5#torchscript-model-export?
I can duplicate your error msg if I use the original "export.py" from yolov5 repo.

@yasenh
Copy link
Owner

yasenh commented Aug 3, 2020

line 28

model.model[-1].export = False
The modification above is required for both cpu & gpu, and the other 2 lines of gpu map location update is optional.

I will revise the instructions little bit later on.

@MHGL
Copy link

MHGL commented Jul 23, 2021

首先非常感谢ultralytics大神,我们团队把yolov5模型重构了,并且复现了和原仓库同样的水平,优势是可以端到端转换移动端模型,如果你有时间有需要,请移步yolov5,期待各位的驾临。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants