neuralmagic / sparseml

Libraries for applying sparsification recipes to neural networks with a few lines of code, enabling faster and smaller models
Apache License 2.0
2.07k stars 148 forks source link

No module named 'sparseml.yolov8' #1391

Closed SuroshAhmadZobair closed 1 year ago

SuroshAhmadZobair commented 1 year ago

Hi,

When i run sparseml.ultralytics.train --help, i get: ModuleNotFoundError: No module named 'sparseml.yolov8' I have tried installing sparseml , pip install -e . , sparseml[ultralytics] and ultralytics=8.0.30 but i still face the same error

  1. OS [Ubuntu 22.04]:
  2. Python version [3.10.0]:
  3. sparseml version [1.4.0]:
  4. ML framework [torch 1.12.1]:
  5. CUDA version:11.6.0 I can't install deepsparse either. could that be the issue?

To Reproduce You can create a new conda env with python 3.10.0 and torch 1.12.1 with cudatoolkit 11.6

Any help is appreciated.

SuroshAhmadZobair commented 1 year ago

Update: Until this is fixed, anyone who is blocked can change the imports in train.py and trainers.py to : from trainers import SparseYOLO Just change sparseml.yolov8.* to trainers and you should be good to go.

corey-nm commented 1 year ago

Hey thanks for raising this! Can you post the full stack trace of the module not found error?

ultralytics support is not in sparseml 1.4, so an install through pypi (pip install sparseml[ultralytics]) won't work.

However if you do a git clone and pip install from that, it should be.

This works for me:

> pip uninstall sparseml sparseml-nightly
> git clone https://github.com/neuralmagic/sparseml.git
> pip install ./sparseml[ultralytics]
> sparseml.ultralytics.train --help

What errors do you get with the above?

corey-nm commented 1 year ago

Ah looks like 1.5 is on nightly now, so you could also install sparseml-nightly from pypi:

pip install sparseml-nightly[ultralytics]