-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
conversion to non-scalar type torch::jit::load("model.pt") #22382
Comments
It looks like you are using a nightly build. We recently changed the output type of load. This should work:
Tutorials/documentation are still for the 1.1 release. It will be updated before we release 1.2. |
@zdevito Thanks,it worked.
|
That assert can just be removed. Module isn't a pointer anymore, it behaves like |
@zdevito I did what you suggested but now I'm stuck here: at::Tensor output = model[0].forward(inputs).toTensor(); I get Illegal instruction
|
🐛 CMake error: conversion from ‘torch::jit::script::Module’ to non-scalar type ‘std::shared_ptrtorch::jit::script::Module .
I am trying to use the torch::jit::load() function,in order to embed my pretrained model
to a c++ project.I am doing exactly what is shown here:https://pytorch.org/tutorials/advanced/cpp_export.html#a-minimal-c-application.I have searched,but I couldn't find a solution here.
The compilation is done with the command
Environment
PyTorch version: 1.1.0
Is debug build: No
CUDA used to build PyTorch: 9.0.176
OS: Ubuntu 16.04.5 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
CMake version: version 3.5.1
Python version: 3.6
Is CUDA available: No
CUDA runtime version: 7.5.17
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Could not collect
Versions of relevant libraries:
The text was updated successfully, but these errors were encountered: