MrYxJ / calculate-flops.pytorch

The calflops is designed to calculate FLOPs、MACs and Parameters in all various neural networks, such as Linear、 CNN、 RNN、 GCN、Transformer(Bert、LlaMA etc Large Language Model)
https://pypi.org/project/calflops/
MIT License
508 stars 16 forks source link

ImportError at 'from calflops import calculate_flops': cannot import name 'is_timm_available' from 'accelerate.utils' #2

Closed biplob1ly closed 1 year ago

biplob1ly commented 1 year ago

Getting an error on google colab with the latest accelerate and transformers version. I do not see any ''is_timm_available' in any release version of accelerate. Any solution to this problem?

[/usr/local/lib/python3.10/dist-packages/calflops/estimate.py](https://localhost:8080/#) in <module>
     20 
     21 from accelerate import init_empty_weights
---> 22 from accelerate.utils import (
     23     # calculate_maximum_sizes,
     24     # convert_bytes, 
     25     is_timm_available,
     26     is_transformers_available,
     27 )

ImportError: cannot import name 'is_timm_available' from 'accelerate.utils' (/usr/local/lib/python3.10/dist-packages/accelerate/utils/__init__.py)
MrYxJ commented 1 year ago

谢谢,MrYx已经收到您的邮件!

Arcmoon-Hu commented 1 year ago

Me too

MrYxJ commented 1 year ago

升级accelerate版本