Giter Site home page Giter Site logo

Comments (2)

yantianj avatar yantianj commented on May 23, 2024

hi, [pcb9382]

我也尝试导出模型到ONNX
I also tried exporting the model to ONNX.
期间报了好几个错
During this period, several errors were reported.

1. AttributeError: Can't get attribute 'StemBlock' on <module 'ultralytics.nn.modules' from '/home/pcb/.local/lib/python3.8/site-packages/ultralytics/nn/modules/init.py'>

在作者自己的ultralytics里是有StemBlock这个函数得,但导出时我们安装使用是官方的包 来自于 命令“pip install ultralytics”
There is a function called StemBlock in the author's own ultralytics, but when exporting, we install and use an official package from the command "pip install ultralytics"

解决办法:
solution:

copy :
xxx\yolov8-face\ultralytics\nn\modules\block.py
xxx\yolov8-face\ultralytics\nn\modules_init_.py
to :
xxx\anaconda\envs\yolov8\Lib\site-packages\ultralytics\nn\modules\block.py
xxx\anaconda\envs\yolov8\Lib\site-packages\ultralytics\nn\modules_init_.py

from yolov8-face.

yantianj avatar yantianj commented on May 23, 2024

I want to export the model as onnx opset 11

I succeeded, and all the steps to try are as follows:

  1. pip install torch==1.8.1 torchvision==0.9.1 torchaudio==0.8.1 -i https://pypi.doubanio.com/simple
    answer from: we0091234/yolov8-plate#2
  1. pip install ultralytics==8.0.134 -i https://pypi.tuna.tsinghua.edu.cn/simple
    version from: xxx/yolov8-face/ultralytics/init.py

copy :
xxx\yolov8-face\ultralytics\nn\modules\block.py
xxx\yolov8-face\ultralytics\nn\modules_init_.py
to :
xxx\anaconda\envs\yolov8\Lib\site-packages\ultralytics\nn\modules\block.py
xxx\anaconda\envs\yolov8\Lib\site-packages\ultralytics\nn\modules_init_.py

  1. code:

export.py

from ultralytics import YOLO

model = YOLO("xxx/yolov8n-face.pt")
success = model.export(format="onnx", opset=11, simplify=True)

from yolov8-face.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.