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

使用pnnx 把pytorch模型转为ncnn模型报错 #3747

Open
DHY-2020 opened this issue Apr 29, 2022 · 0 comments
Open

使用pnnx 把pytorch模型转为ncnn模型报错 #3747

DHY-2020 opened this issue Apr 29, 2022 · 0 comments

Comments

@DHY-2020
Copy link

error log | 日志或报错信息 | ログ

model | 模型 | モデル

  1. original model
    通过torch.jit.trace序列化后保存的pytorch模型
    image

how to reproduce | 复现步骤 | 再現方法

vm-ubuntu@ubuntu:~/work_space/DHY/ncnn-master/tools/pnnx/build/install/bin$ ./pnnx track_track_pnnx.pt inputshape=[1,256,6,6]f32 inputshape2=[1,3,287,287]i8
pnnxparam = track_track_pnnx.pnnx.param
pnnxbin = track_track_pnnx.pnnx.bin
pnnxpy = track_track_pnnx_pnnx.py
ncnnparam = track_track_pnnx.ncnn.param
ncnnbin = track_track_pnnx.ncnn.bin
ncnnpy = track_track_pnnx_ncnn.py
optlevel = 2
device = cpu
inputshape = [1,256,6,6]f32
inputshape2 = [1,3,287,287]i8
customop =
moduleop =
############# pass_level0
inline module = pysot.models.backbone.alexnet.AlexNetLegacy
inline module = pysot.models.head.rpn.DepthwiseRPN
inline module = pysot.models.head.rpn.DepthwiseXCorr
inline module = pysot.models.backbone.alexnet.AlexNetLegacy
inline module = pysot.models.head.rpn.DepthwiseRPN
inline module = pysot.models.head.rpn.DepthwiseXCorr
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 75 76 77 81 82 83 batch.2 channel.2 k_2.2 k_3.2 x_2.2 x_3.2 102 x.2 106 kernel.2 out.2 out_2.2 out_3.2 input0.2 127 128 129 130 145 146 147 151 152 153 batch.1 channel.1 k_2.1 k_3.1 x_2.1 x_3.1 172 x.1 176 kernel.1 out.1 out_2.1 out_3.1 input0.1 197 198 199 200 12 13

terminate called after throwing an instance of 'c10::Error'
what(): forward() is missing value for argument 'input0'. Declaration: forward(torch.pysot.models.model_builder.ModelBuilder self, Tensor input, Tensor input0) -> ((Tensor, Tensor))
Exception raised from checkAndNormalizeInputs at ../aten/src/ATen/core/function_schema_inl.h:239 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits, std::allocator >) + 0x69 (0x7fd0bc7f4b29 in /home/vm-ubuntu/work_space/DHY/ncnn-master/tools/pnnx/build/install/bin/libc10.so)
frame #1: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) + 0xd2 (0x7fd0bc7f1ab2 in /home/vm-ubuntu/work_space/DHY/ncnn-master/tools/pnnx/build/install/bin/libc10.so)
frame #2: + 0xd0f7e5 (0x7fd0ab5997e5 in /home/vm-ubuntu/work_space/DHY/ncnn-master/tools/pnnx/build/install/bin/libtorch_cpu.so)
frame #3: torch::jit::GraphFunction::operator()(std::vector<c10::IValue, std::allocatorc10::IValue >, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, c10::IValue, std::hash<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, c10::IValue> > > const&) + 0x2d (0x7fd0adc01bdd in /home/vm-ubuntu/work_space/DHY/ncnn-master/tools/pnnx/build/install/bin/libtorch_cpu.so)
frame #4: torch::jit::Method::operator()(std::vector<c10::IValue, std::allocatorc10::IValue >, std::unordered_map<std::__cxx11::basic_string<char, std::char_traits, std::allocator >, c10::IValue, std::hash<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::equal_to<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits, std::allocator > const, c10::IValue> > > const&) + 0x16a (0x7fd0adc1109a in /home/vm-ubuntu/work_space/DHY/ncnn-master/tools/pnnx/build/install/bin/libtorch_cpu.so)
frame #5: ./pnnx() [0x449294]
frame #6: ./pnnx() [0x445c74]
frame #7: ./pnnx() [0x40b149]
frame #8: __libc_start_main + 0xf0 (0x7fd0a99d9840 in /lib/x86_64-linux-gnu/libc.so.6)
frame #9: ./pnnx() [0x414039]

已放弃 (核心已转储)

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

1 participant