Lyken17 / pytorch-OpCounter

Count the MACs / FLOPs of your PyTorch model.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not compatible with python3.10

tothedistance opened this issue · comments

ImportError: cannot import name 'Iterable' from 'collections'
as python3.10 changed it to collections.abc

Thanks for the pointer. Will push a if-else stament to fix.

@Lyken17 it looks like this is already changed in master branch! (in commit 439ca20d99792fb0bd46e98a2a2640a049bbca37) Do you plan to release a new version of this package to PyPI?

Oops. forget to update.

Just uploaded a new version to PyPi. Please check.

thop history in pypi show the most recent revison dates back to may 5, 2020. And i create a new enviroment and install thop, the error is still there. am I missing something

That's caused by version number mismatch and 0.0.5 (version number I used git) is less than 0.0.31.

Just reuploaded and newer version should be avaliable on pypi .

onnx does not support python3.10 yet. so new error occured in import. but i assume the problem of collections is solved.

Let me try to move onnx import to a deeper location and see whether it helps.