-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
yolov8s-pose转ncnn #4649
Comments
https://zhuanlan.zhihu.com/p/622596922 |
谢谢三木,问题解决了!!! |
@Rachel-liuqr I have great news 😃! I've recently added official support for Ultralytics YOLOv8 NCNN export ✅ in PR ultralytics/ultralytics#3529 with the help of @nihui which is part of You can now export with CLI:
or Python: from ultralytics import YOLO
# Create a model
model = YOLO('yolov8n.pt')
# Export the model to NCNN with arguments
model.export(format='ncnn', half=True, imgsz=640) Output is a To get this update:
Please let us know if NCNN export is working correctly for you, and don't hesitate to report any other issues you find or feature requests you may have. Happy training with YOLOv8 🚀! |
@glenn-jocher |
@triple-Mu |
针对onnx模型转换的各种问题,推荐使用最新的pnnx工具转换到ncnn pip install pnnx
pnnx model.onnx inputshape=[1,3,224,224] 详细参考文档 |
yolov8 example #5506 |
hi, yolov8 examples are updated with full support for detection, segmentation, classification, pose estimation and obb android demo detailed instruction (zh) |
error log | 日志或报错信息 | ログ
model | 模型 | モデル
how to reproduce | 复现步骤 | 再現方法
1.yolov8s-pose.pt转onnx后,再使用ncnn2onnx时报错:
Unsupported slice step!
ScatterND not supported yet!
2.然后尝试先转为torchscript
转torchscript代码如下:
from ultralytics import YOLO
model = YOLO("yolov8s-pose.pt") # load a pretrained model (recommended for training)
success = model.export(format="torchscript", simplify=True) # export the model to onnx format
assert success
再使用pnnx工具转模型,输入命令如下
./pnnx yolov8s-pose.torchscript inputshape=[1,3,640,640]
报错如下
pnnxparam = yolov8s-pose.pnnx.param
pnnxbin = yolov8s-pose.pnnx.bin
pnnxpy = yolov8s-pose_pnnx.py
pnnxonnx = yolov8s-pose.pnnx.onnx
ncnnparam = yolov8s-pose.ncnn.param
ncnnbin = yolov8s-pose.ncnn.bin
ncnnpy = yolov8s-pose_ncnn.py
fp16 = 1
optlevel = 2
device = cpu
inputshape = [1,3,640,640]f32
inputshape2 =
customop =
moduleop =
############# pass_level0
inline module = ultralytics.nn.modules.Bottleneck
inline module = ultralytics.nn.modules.C2f
inline module = ultralytics.nn.modules.Concat
inline module = ultralytics.nn.modules.Conv
inline module = ultralytics.nn.modules.DFL
inline module = ultralytics.nn.modules.Pose
inline module = ultralytics.nn.modules.SPPF
inline module = ultralytics.nn.modules.Bottleneck
inline module = ultralytics.nn.modules.C2f
inline module = ultralytics.nn.modules.Concat
inline module = ultralytics.nn.modules.Conv
inline module = ultralytics.nn.modules.DFL
inline module = ultralytics.nn.modules.Pose
inline module = ultralytics.nn.modules.SPPF
############# pass_level1
unknown Parameter value kind prim::Constant of TensorType, t.dim = 2
unknown Parameter value kind prim::Constant of TensorType, t.dim = 2
unknown Parameter value kind prim::Constant of TensorType, t.dim = 2
unknown Parameter value kind prim::Constant of TensorType, t.dim = 2
unknown Parameter value kind prim::Constant of TensorType, t.dim = 2
unknown Parameter value kind prim::Constant of TensorType, t.dim = 2
############# pass_level2
############# pass_level3
############# pass_level4
############# pass_level5
make_slice_expression input 206
make_slice_expression self 207
make_slice_expression src 209
make_slice_expression input 210
make_slice_expression self 214
make_slice_expression src 216
make_slice_expression input 217
make_slice_expression self 221
make_slice_expression src 223
############# pass_ncnn
force batch axis 233 for operand 212
force batch axis 233 for operand 219
force batch axis 233 for operand pnnx_expr_35_sub(212,5.000000e-01)
force batch axis 233 for operand pnnx_expr_9_sub(219,5.000000e-01)
binaryop broadcast across batch axis 0 and 233 is not supported
binaryop broadcast across batch axis 0 and 233 is not supported
binaryop broadcast across batch axis 0 and 233 is not supported
binaryop broadcast across batch axis 0 and 233 is not supported
binaryop broadcast across batch axis 0 and 233 is not supported
select along batch axis 0 is not supported
select along batch axis 0 is not supported
slice with step 3 is not supported
slice with step 3 is not supported
slice with step 3 is not supported
slice_copy with step 3 is not supported
slice_copy with step 3 is not supported
slice_copy with step 3 is not supported
ignore Crop select_0 param dim=0
ignore Crop select_0 param index=0
ignore Crop select_1 param dim=0
ignore Crop select_1 param index=1
技穷了,请大神赐教!!!
The text was updated successfully, but these errors were encountered: