Lyken17 / pytorch-OpCounter

Count the MACs / FLOPs of your PyTorch model.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

thop/profile.py:12: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead. `if LooseVersion(torch.__version__) < LooseVersion("1.0.0"):`

glenn-jocher opened this issue · comments

I'm seeing a DeprecationWarning when running YOLOv8 tests. This looks pretty simple, I think we just need to update thop/profile.py:12 as mentioned to us pkg_resources as follows:

import pkg_resources as pkg

pkg.parse_version(torch.__version__)

I'll try to submit a PR.

See Ultralytics CI Tests for examples of the deprecation warning:

https://github.com/ultralytics/ultralytics/actions/runs/4380005063/jobs/7666578652
Screenshot 2023-03-10 at 19 21 46