RollingDepth icon indicating copy to clipboard operation
RollingDepth copied to clipboard

Can't install diffusers

Open G23yl opened this issue 1 year ago • 3 comments

My machine is Ubuntu20.04 + python==3.12.12.

When I run bash script/install_diffusers_dev.sh, it will corrupt during installing pyarrow

My torch version is 2.4.1+cu121

Image

The error is below:

Image

G23yl avatar Nov 01 '25 03:11 G23yl

Hi, I hit a very similar issue on RollingDepth (the install_diffusers_dev.sh / pyarrow part), and this is what worked for me.

What fixed it

  1. Use Python 3.10 (not 3.12) in a fresh conda env.
  2. Patch the install script to avoid pip dependency re-resolution (that’s what was triggering the datasets -> pyarrow<4 / build-deps mess for me).

Patch (one-line change)

In script/install_diffusers_dev.sh, I changed this line: https://github.com/prs-eth/RollingDepth/blob/c233765fb7adf9682442a9fbef3eb07212bb70fd/script/install_diffusers_dev.sh#L8

from pip install -e ".[dev]" to pip install -e ".[dev]" --no-deps

My working environment (for reference)

Python 3.10.19

torch       2.4.1+cu124
torchvision 0.19.1+cu124
torchaudio  2.4.1+cu124

diffusers   0.30.0
datasets    2.19.2
pyarrow     14.0.2
pyarrow-hotfix 0.7
numpy       1.26.4

zihos avatar Jan 28 '26 01:01 zihos

@zihos Hi, I am using your alternation, but still face errors as follows, I will be grateful if you could kindly help with this.

(rd) $ python run_video.py \
>     -i data/samples \
>     -o output/samples_fast \
>     -p fast \
>     --verbose
!!!!!!!!!!!!!! [RollingDepth] Using modified Diffusers for cross-frame self-attention !!!!!!!!!!!!!!
Traceback (most recent call last):
  File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/utils/import_utils.py", line 811, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "/hpc2hdd/home/hongfeizhang/opt/anaconda3/envs/rd/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/pipelines/pipeline_utils.py", line 69, in <module>
    from .pipeline_loading_utils import (
  File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/pipelines/pipeline_loading_utils.py", line 48, in <module>
    from transformers.utils import FLAX_WEIGHTS_NAME as TRANSFORMERS_FLAX_WEIGHTS_NAME
ImportError: cannot import name 'FLAX_WEIGHTS_NAME' from 'transformers.utils' (/hpc2hdd/home/hongfeizhang/opt/anaconda3/envs/rd/lib/python3.10/site-packages/transformers/utils/__init__.py)

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

Traceback (most recent call last):
  File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/run_video.py", line 32, in <module>
    from rollingdepth import (
  File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/rollingdepth/__init__.py", line 22, in <module>
    from .rollingdepth_pipeline import RollingDepthOutput, RollingDepthPipeline  # noqa: F401
  File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/rollingdepth/rollingdepth_pipeline.py", line 32, in <module>
    from diffusers import (
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/utils/import_utils.py", line 802, in __getattr__
    value = getattr(module, name)
  File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/utils/import_utils.py", line 801, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/utils/import_utils.py", line 813, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import diffusers.pipelines.pipeline_utils because of the following error (look up to see its traceback):
cannot import name 'FLAX_WEIGHTS_NAME' from 'transformers.utils' (/hpc2hdd/home/hongfeizhang/opt/anaconda3/envs/rd/lib/python3.10/site-packages/transformers/utils/__init__.py)
(rd) hongfeizhang@mgmt-3:~/hongfei_workspace/RollingDepth$

soyouthinkyoucantell avatar Feb 21 '26 13:02 soyouthinkyoucantell

@zihos Hi, I am using your alternation, but still face errors as follows, I will be grateful if you could kindly help with this.

(rd) $ python run_video.py \

-i data/samples \
-o output/samples_fast \
-p fast \
--verbose

!!!!!!!!!!!!!! [RollingDepth] Using modified Diffusers for cross-frame self-attention !!!!!!!!!!!!!! Traceback (most recent call last): File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/utils/import_utils.py", line 811, in _get_module return importlib.import_module("." + module_name, self.name) File "/hpc2hdd/home/hongfeizhang/opt/anaconda3/envs/rd/lib/python3.10/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/pipelines/pipeline_utils.py", line 69, in from .pipeline_loading_utils import ( File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/pipelines/pipeline_loading_utils.py", line 48, in from transformers.utils import FLAX_WEIGHTS_NAME as TRANSFORMERS_FLAX_WEIGHTS_NAME ImportError: cannot import name 'FLAX_WEIGHTS_NAME' from 'transformers.utils' (/hpc2hdd/home/hongfeizhang/opt/anaconda3/envs/rd/lib/python3.10/site-packages/transformers/utils/init.py)

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

Traceback (most recent call last): File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/run_video.py", line 32, in from rollingdepth import ( File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/rollingdepth/init.py", line 22, in from .rollingdepth_pipeline import RollingDepthOutput, RollingDepthPipeline # noqa: F401 File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/rollingdepth/rollingdepth_pipeline.py", line 32, in from diffusers import ( File "", line 1075, in _handle_fromlist File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/utils/import_utils.py", line 802, in getattr value = getattr(module, name) File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/utils/import_utils.py", line 801, in getattr module = self._get_module(self._class_to_module[name]) File "/hpc2hdd/home/hongfeizhang/hongfei_workspace/RollingDepth/diffusers/src/diffusers/utils/import_utils.py", line 813, in _get_module raise RuntimeError( RuntimeError: Failed to import diffusers.pipelines.pipeline_utils because of the following error (look up to see its traceback): cannot import name 'FLAX_WEIGHTS_NAME' from 'transformers.utils' (/hpc2hdd/home/hongfeizhang/opt/anaconda3/envs/rd/lib/python3.10/site-packages/transformers/utils/init.py) (rd) hongfeizhang@mgmt-3:~/hongfei_workspace/RollingDepth$

Fixed by downgrading 'transformer' to 4.32.1

soyouthinkyoucantell avatar Apr 23 '26 06:04 soyouthinkyoucantell