module ‘torch.compiler‘ has no attribute ‘is_compiling‘
问题描述
packages\transformers\image_processing_utils_fast.py", line 361, in resizeif torch.compiler.is_compiling() and is_rocm_platform():
AttributeError: module 'torch.compiler' has no attribute 'is_compiling'
解决方法
修改transformers,如下:
if hasattr(torch.compiler, 'is_compiling') and torch.compiler.is_compiling() and is_rocm_platform():
或者降低版本,执行命令:
pip install transformers==4.37.0 # or another version compatible with your PyTorch
或者升级pytorch版本,
pip install --upgrade torch>=2.3.0 torchvision>=0.18.0
