Open SEMLLYCAT opened 9 months ago
@nihui
针对onnx模型转换的各种问题,推荐使用最新的pnnx工具转换到ncnn In view of various problems in onnx model conversion, it is recommended to use the latest pnnx tool to convert your model to ncnn
pip install pnnx
pnnx model.onnx inputshape=[1,3,224,224]
详细参考文档 Detailed reference documentation https://github.com/pnnx/pnnx https://github.com/Tencent/ncnn/wiki/use-ncnn-with-pytorch-or-onnx#how-to-use-pnnx
error log | 日志或报错信息 | ログ
FATAL ERROR! pool allocator destroyed too early (nil) still in use
context | 编译/运行环境 | バックグラウンド
最新
how to reproduce | 复现步骤 | 再現方法
import torch as nn import torch.nn.functional as FF
def unfold(input): B, C, T, F = input.shape input = FF.pad(input, (1,1)) output = [] for i in range(C): output_c = torch.cat([input[:, i, :, :F], input[:, i, :, 1:F+1], input[:, i, :, 2:F+2], dim=1) output.append(output_C) output = torch.cat(output, dim=1) return output class D(nn.Module): def init(self, k=3): self.k = 3 def forward(self, x): x = unfold(x).reshape(x.shape[0], x.shape[1]*k, x.shape[2], x.shape[3]) y = unfold(x) return y if name == "main": device = torch.device("cpu") model = D.to(device).eval() x = torch.randn(1, 7, 1, 19) with torch.no_grad(): y = model(x)
more | 其他 | その他
问题: