Skip to content

Error "cannot import name 'FqnToConfig' from 'torchao.quantization'" when importing the diffusers library on google colab #15085

Closed

Description

@WiNE-iNEFF

Describe the bug

When attempting to import the diffusers library (version 0.39.0—the latest version available in Colab) in Google Colab, an error occurs:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/usr/local/lib/python3.13/dist-packages/diffusers/utils/import_utils.py in _get_module(self, module_name)
   1014         try:
-> 1015             return importlib.import_module("." + module_name, self.__name__)
   1016         except Exception as e:

35 frames
ImportError: cannot import name 'FqnToConfig' from 'torchao.quantization' (/usr/local/lib/python3.13/dist-packages/torchao/quantization/__init__.py)

The above exception was the direct cause of the following exception:

RuntimeError                              Traceback (most recent call last)
RuntimeError: Failed to import diffusers.models.unets.unet_2d because of the following error (look up to see its traceback):
cannot import name 'FqnToConfig' from 'torchao.quantization' (/usr/local/lib/python3.13/dist-packages/torchao/quantization/__init__.py)

The above exception was the direct cause of the following exception:

RuntimeError                              Traceback (most recent call last)
/usr/local/lib/python3.13/dist-packages/diffusers/utils/import_utils.py in _get_module(self, module_name)
   1015             return importlib.import_module("." + module_name, self.__name__)
   1016         except Exception as e:
-> 1017             raise RuntimeError(
   1018                 f"Failed to import {self.__name__}.{module_name} because of the following error (look up to see its"
   1019                 f" traceback):\n{e}"

RuntimeError: Failed to import diffusers.pipelines.ddpm.pipeline_ddpm because of the following error (look up to see its traceback):
Failed to import diffusers.models.unets.unet_2d because of the following error (look up to see its traceback):
cannot import name 'FqnToConfig' from 'torchao.quantization' (/usr/local/lib/python3.13/dist-packages/torchao/quantization/__ini

Attempts to update the libraries via pip also yield no results.

Reproduction

!pip install diffusers

from diffusers import DDIMScheduler

Logs

System Info

Google Colab, Diffusers=0.39.0, Python 3.13.15

Who can help?

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions