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

terminate called after throwing an instance of 'c10::Error' #12

Closed
zhengli233 opened this issue May 23, 2019 · 4 comments
Closed

terminate called after throwing an instance of 'c10::Error' #12

zhengli233 opened this issue May 23, 2019 · 4 comments

Comments

@zhengli233
Copy link

zhengli233 commented May 23, 2019

This error showed when loading the weights file:

terminate called after throwing an instance of 'c10::Error'
what(): !is_variable() INTERNAL ASSERT FAILED at /pytorch/c10/core/TensorImpl.h:927, please report a bug to PyTorch. (shallow_copy_and_detach at /pytorch/c10/core/TensorImpl.h:927)
frame #0: std::function<std::string ()>::operator()() const + 0x11 (0x7f54a6c17961 in /home/zhengli/Pytorch/libtorch-shared-with-deps-latest/libtorch/lib/libc10.so)
frame #1: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x2a (0x7f54a6c1729a in /home/zhengli/Pytorch/libtorch-shared-with-deps-latest/libtorch/lib/libc10.so)
frame #2: + 0x2f662b9 (0x7f549de102b9 in /home/zhengli/Pytorch/libtorch-shared-with-deps-latest/libtorch/lib/libcaffe2.so)
frame #3: torch::autograd::Variable::Impl::set_data(at::Tensor const&) + 0x278 (0x7f549de0d5b8 in /home/zhengli/Pytorch/libtorch-shared-with-deps-latest/libtorch/lib/libcaffe2.so)
frame #4: at::Tensor::set_data(at::Tensor) + 0x53 (0x558b6a423363 in ./yolo-app)
frame #5: Darknet::load_weights(char const*) + 0x625 (0x558b6a416335 in ./yolo-app)
frame #6: main + 0x206 (0x558b6a40ef06 in ./yolo-app)
frame #7: __libc_start_main + 0xe7 (0x7f5499755b97 in /lib/x86_64-linux-gnu/libc.so.6)
frame #8: _start + 0x2a (0x558b6a40ff7a in ./yolo-app)

Aborted (core dumped)

Does anyone have the same problem?

@jlcai5
Copy link

jlcai5 commented May 24, 2019

yes l have sample problem in linux fow v1.1.0

@zhengli233
Copy link
Author

Solved.
Replace every

torch::TensorFromBlob

to

at::from_blob

like

at::from_blob(weights_src, {length/4}).to(torch::kFloat32)

There will be 3 totally.

@Crystal-Ann
Copy link

thanks a lot!

@walktree walktree pinned this issue Jul 17, 2019
This was referenced Aug 6, 2019
@soulslicer
Copy link

How do I change this line

at::Tensor weights = torch::CPU(torch::kFloat32).tensorFromBlob(weights_src, {length/4});

to the

from blob api??

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

4 participants