YOLO-Training-Optimization-Pose-Estimation-and-Tracking icon indicating copy to clipboard operation
YOLO-Training-Optimization-Pose-Estimation-and-Tracking copied to clipboard

Optimize yolov8 with Apache TVM

Open MisterFlos opened this issue 11 months ago • 0 comments

Hello, Did you succeed to optimize yolov8 with tvm? I see your yolov8_tvm.ipynb is empty...

When I try to compile it and run it with tvmc I get this error: TVMError: Assert fail: T.tvm_struct_get(p0, 0, 10, "int32") == 4, Argument tvmgen_default_fused_nn_conv2d_add_sigmoid_multiply.p0.device_type has an unsatisfied constraint: 4 == T.tvm_struct_get(p0, 0, 10, "int32")

My code is the following:

import os
import sys
import tvm
from tvm.driver import tvmc`

model = tvmc.load(model_file)  # using a .onnx file exported from ultralytics
soc = 'rk3588'
gpu_target = tvm.target.mali(model=soc)
target_host = tvm.target.arm_cpu(model=soc)
target = tvm.target.Target(target=gpu_target, host=target_host)

package = tvmc.compile(model, target=str(target))
result = tvmc.run(package, device="cpu")
print(result)

MisterFlos avatar Mar 12 '24 09:03 MisterFlos