You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the YOLOv8 issues and discussions and found no similar questions.
Question
I want to use torch-prune after training my model by yolov8,but i found i can't import ultralytics.yolo like this:from ultralytics.yolo.engine.model import TASK_MAP
Additional
No response
The text was updated successfully, but these errors were encountered:
👋 Hello @cbt12123, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.
If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.
Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.
YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.
@cbt12123 hello! It looks like you're trying to import a module in a way that isn't supported by the current structure of the Ultralytics YOLO repository. Instead of using from ultralytics.yolo.engine.model import TASK_MAP, you should use the following import statement:
fromultralyticsimportYOLO
After importing the YOLO class, you can load your model and access various functionalities provided by the YOLOv8 API. If you need to perform operations like pruning, you might need to work directly with the underlying PyTorch model, which can be accessed via:
model=YOLO('path/to/your/model.pt')
torch_model=model.model# This is the PyTorch model
From there, you can apply torch-prune or other PyTorch-based operations. If you have further questions or run into issues, feel free to ask! 🚀
Search before asking
Question
I want to use torch-prune after training my model by yolov8,but i found i can't import ultralytics.yolo like this:
from ultralytics.yolo.engine.model import TASK_MAP
Additional
No response
The text was updated successfully, but these errors were encountered: