Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fail #423

Closed
LukeLIN-web opened this issue Nov 10, 2024 · 6 comments
Closed

Install fail #423

LukeLIN-web opened this issue Nov 10, 2024 · 6 comments

Comments

@LukeLIN-web
Copy link

Collecting xformers>=0.0.20 (from -r requirements/pt2.txt (line 40))
  Downloading xformers-0.0.28.post3.tar.gz (7.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.8/7.8 MB 14.5 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
 
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vy2ajg1x/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-vy2ajg1x/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 303, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-vy2ajg1x/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 521, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-vy2ajg1x/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 319, in run_setup
          exec(code, locals())
        File "<string>", line 24, in <module>
      ModuleNotFoundError: No module named 'torch'
@ToruKiyono
Copy link

Aha.The error message indicates how to solve the problem.Just run pip install torch and then reinstall it.

@scooller
Copy link

What version of Torch?

@scooller
Copy link

scooller commented Nov 16, 2024

I make it work, i change the requirements/pt2.txt file with

_
black==23.7.0
chardet==5.1.0
clip @ git+https://github.com/openai/CLIP.git
einops>=0.6.1
fairscale>=0.4.13
fire>=0.5.0
fsspec>=2023.6.0
invisible-watermark>=0.2.0
kornia==0.6.9
matplotlib>=3.7.2
natsort>=8.4.0
ninja>=1.11.1
numpy>=1.24.4
omegaconf>=2.3.0
open-clip-torch>=2.20.0
opencv-python==4.6.0.66
pandas>=2.0.3
pillow>=9.5.0
pudb>=2022.1.3
pytorch-lightning==2.0.1
pyyaml>=6.0.1
rembg
scipy>=1.10.1
streamlit>=0.73.1
tensorboardx==2.6
timm>=0.9.2
tokenizers==0.12.1
torch==2.0.1
torchaudio>=2.0.2
torchdata==0.6.1
torchmetrics>=1.0.1
torchvision>=0.15.2
tqdm>=4.65.0
transformers==4.19.1
urllib3<1.27,>=1.25.4
wandb>=0.15.6
webdataset>=0.2.33
wheel>=0.41.0
--extra-index-url https://download.pytorch.org/whl/cu118
xformers==0.0.20
gradio
streamlit-keyup==0.2.0
numpy<2.0
_

@LukeLIN-web
Copy link
Author

LukeLIN-web commented Nov 17, 2024

I make it work, i change the requirements/pt2.txt file with

_ black==23.7.0 chardet==5.1.0 clip @ git+https://github.com/openai/CLIP.git einops>=0.6.1 fairscale>=0.4.13 fire>=0.5.0 fsspec>=2023.6.0 invisible-watermark>=0.2.0 kornia==0.6.9 matplotlib>=3.7.2 natsort>=8.4.0 ninja>=1.11.1 numpy>=1.24.4 omegaconf>=2.3.0 open-clip-torch>=2.20.0 opencv-python==4.6.0.66 pandas>=2.0.3 pillow>=9.5.0 pudb>=2022.1.3 pytorch-lightning==2.0.1 pyyaml>=6.0.1 rembg scipy>=1.10.1 streamlit>=0.73.1 tensorboardx==2.6 timm>=0.9.2 tokenizers==0.12.1 torch==2.0.1 torchaudio>=2.0.2 torchdata==0.6.1 torchmetrics>=1.0.1 torchvision>=0.15.2 tqdm>=4.65.0 transformers==4.19.1 urllib3<1.27,>=1.25.4 wandb>=0.15.6 webdataset>=0.2.33 wheel>=0.41.0 --extra-index-url https://download.pytorch.org/whl/cu118 xformers==0.0.20 gradio streamlit-keyup==0.2.0 numpy<2.0 _

Thank you, we need to lock the version of torch, xformers and numpy

I meet a problem

 error: can't find Rust compiler
      
      If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
      
      To update pip, run:
      
          pip install --upgrade pip
      
      and then retry package installation.
      
      If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
      [end of output]

@scooller
Copy link

You need to install Rust before installing transformers.
The standard way to install (from the rust documentation) is
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

@LukeLIN-web
Copy link
Author

LukeLIN-web commented Nov 18, 2024

You need to install Rust before installing transformers. The standard way to install (from the rust documentation) is curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Thank you. I have a problem

   warning: variable does not need to be mutable
         --> tokenizers-lib/src/models/unigram/model.rs:282:21
          |
      282 |                 let mut target_node = &mut best_path_ends_at[starts_at + mblen];
          |                     ----^^^^^^^^^^^
          |                     |
          |                     help: remove this `mut`
      
      warning: variable does not need to be mutable
         --> tokenizers-lib/src/pre_tokenizers/byte_level.rs:200:59
          |
      200 |     encoding.process_tokens_with_offsets_mut(|(i, (token, mut offsets))| {
          |                                                           ----^^^^^^^
          |                                                           |
          |                                                           help: remove this `mut`
      
      error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
         --> tokenizers-lib/src/models/bpe/trainer.rs:526:47
          |
      522 |                     let w = &words[*i] as *const _ as *mut _;
          |                             -------------------------------- casting happend here
      ...
      526 |                         let word: &mut Word = &mut (*w);
          |                                               ^^^^^^^^^
          |
          = note: for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html>
          = note: `#[deny(invalid_reference_casting)]` on by default
      
      warning: `tokenizers` (lib) generated 3 warnings
      error: could not compile `tokenizers` (lib) due to 1 previous error; 3 warnings emitted

Maybe this is because python 3.11?

Update: I try again with python 3.10 , and pip install successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants