zkonduit / ezkl

ezkl is an engine for doing inference for deep learning models and other computational graphs in a zk-snark (ZKML). Use it from Python, Javascript, or the command line.
https://docs.ezkl.xyz/
919 stars 129 forks source link

ezkl cli gen-settings: [graph] a node is missing required params: padding #840

Open pdibitonto opened 2 weeks ago

pdibitonto commented 2 weeks ago

I was testing ezkl with a publicly available model YOLOv8s-worldv2 but I'm receiving an error when I fire the gen-settings command, the error is the following: [graph] a node is missing required params: padding

Steps to reproduce the bug

To reproduce the bug:

  1. Download the YOLOv8s-worldv2 model here

  2. Export the model to onnx with the following python script:

    from ultralytics import YOLO
    model = YOLO("yolov8s-worldv2.pt")
    model.export(format = "onnx")
  3. In the same directory, try the gen-settings cli command as follow:

    ezkl gen-settings --model yolov8s-worldv2.onnx --input-visibility hashed --output-visibility public

Device and Operating System

OS: Ubuntu 22.04.4 Version: 22.04.4 LTS Processor: Intel® Core™ i7-10750H Memory: 32 GB

Additional Information

  1. Python version: 3.8.16+
  2. Required python module for onnx export: ultralytics
pdibitonto commented 2 weeks ago

Dunno if those details are useful, but I've printed the model (already exported to onnx) graph padding values and they are presents for each node, I've used this script:

import onnx

# Load the ONNX model
model = onnx.load("yolov8s-worldv2.onnx")

# Access the graph
graph = model.graph

for node in graph.node:
    if node.op_type == 'Conv':  # Look for Convolution nodes
        print(f"Node name: {node.name}")
        for attr in node.attribute:
            if attr.name == 'pads':  # 'pads' attribute contains padding info
                print(f"Padding: {attr.ints}")

Let me know if others infos are needed