BLIP
BLIP copied to clipboard
Demo Google Colab not working
Seems like the dependencytransformers==4.15.0
has a dependency tokenizers<0.11,>=0.10.1
and due to rust missing I am getting the following while installing dependencies with pip3
Running in Colab.
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting transformers==4.15.0
Downloading transformers-4.15.0-py3-none-any.whl (3.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 16.6 MB/s eta 0:00:00
Collecting timm==0.4.12
Downloading timm-0.4.12-py3-none-any.whl (376 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 377.0/377.0 kB 26.5 MB/s eta 0:00:00
Collecting fairscale==0.4.4
Downloading fairscale-0.4.4.tar.gz (235 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 235.4/235.4 kB 19.1 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.10/dist-packages (from transformers==4.15.0) (1.22.4)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from transformers==4.15.0) (23.1)
Collecting sacremoses
Downloading sacremoses-0.0.53.tar.gz (880 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 880.6/880.6 kB 49.1 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting tokenizers<0.11,>=0.10.1
Downloading tokenizers-0.10.3.tar.gz (212 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 212.7/212.7 kB 27.9 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: filelock in /usr/local/lib/python3.10/dist-packages (from transformers==4.15.0) (3.12.0)
Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.10/dist-packages (from transformers==4.15.0) (2022.10.31)
Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.10/dist-packages (from transformers==4.15.0) (4.65.0)
Collecting huggingface-hub<1.0,>=0.1.0
Downloading huggingface_hub-0.14.1-py3-none-any.whl (224 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 224.5/224.5 kB 23.5 MB/s eta 0:00:00
Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from transformers==4.15.0) (2.27.1)
Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.10/dist-packages (from transformers==4.15.0) (6.0)
Requirement already satisfied: torchvision in /usr/local/lib/python3.10/dist-packages (from timm==0.4.12) (0.15.1+cu118)
Requirement already satisfied: torch>=1.4 in /usr/local/lib/python3.10/dist-packages (from timm==0.4.12) (2.0.0+cu118)
Requirement already satisfied: fsspec in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.1.0->transformers==4.15.0) (2023.4.0)
Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.10/dist-packages (from huggingface-hub<1.0,>=0.1.0->transformers==4.15.0) (4.5.0)
Requirement already satisfied: sympy in /usr/local/lib/python3.10/dist-packages (from torch>=1.4->timm==0.4.12) (1.11.1)
Requirement already satisfied: triton==2.0.0 in /usr/local/lib/python3.10/dist-packages (from torch>=1.4->timm==0.4.12) (2.0.0)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.10/dist-packages (from torch>=1.4->timm==0.4.12) (3.1.2)
Requirement already satisfied: networkx in /usr/local/lib/python3.10/dist-packages (from torch>=1.4->timm==0.4.12) (3.1)
Requirement already satisfied: lit in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch>=1.4->timm==0.4.12) (16.0.2)
Requirement already satisfied: cmake in /usr/local/lib/python3.10/dist-packages (from triton==2.0.0->torch>=1.4->timm==0.4.12) (3.25.2)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.15.0) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.15.0) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.15.0) (1.26.15)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->transformers==4.15.0) (2022.12.7)
Requirement already satisfied: six in /usr/local/lib/python3.10/dist-packages (from sacremoses->transformers==4.15.0) (1.16.0)
Requirement already satisfied: click in /usr/local/lib/python3.10/dist-packages (from sacremoses->transformers==4.15.0) (8.1.3)
Requirement already satisfied: joblib in /usr/local/lib/python3.10/dist-packages (from sacremoses->transformers==4.15.0) (1.2.0)
Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /usr/local/lib/python3.10/dist-packages (from torchvision->timm==0.4.12) (8.4.0)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.10/dist-packages (from jinja2->torch>=1.4->timm==0.4.12) (2.1.2)
Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.10/dist-packages (from sympy->torch>=1.4->timm==0.4.12) (1.3.0)
Building wheels for collected packages: fairscale, tokenizers, sacremoses
Building wheel for fairscale (pyproject.toml) ... done
Created wheel for fairscale: filename=fairscale-0.4.4-py3-none-any.whl size=292853 sha256=207c16387300344cee5c0e47db8b451191d37346f18e17486b9a02fc0c1f9d77
Stored in directory: /root/.cache/pip/wheels/08/58/6f/56c57fa8315eb0bcf0287b580c850845be5f116359b809e9f1
error: subprocess-exited-with-error
× Building wheel for tokenizers (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for tokenizers (pyproject.toml) ... error
ERROR: Failed building wheel for tokenizers
Building wheel for sacremoses (setup.py) ... done
Created wheel for sacremoses: filename=sacremoses-0.0.53-py3-none-any.whl size=895259 sha256=250d37e60ad5f1438a9e2f27b3eeb41d508714d0d62dea2617d0e4e790b5d697
Stored in directory: /root/.cache/pip/wheels/00/24/97/a2ea5324f36bc626e1ea0267f33db6aa80d157ee977e9e42fb
Successfully built fairscale sacremoses
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects
Cloning into 'BLIP'...
remote: Enumerating objects: 274, done.
remote: Total 274 (delta 0), reused 0 (delta 0), pack-reused 274
Receiving objects: 100% (274/274), 7.16 MiB | 37.20 MiB/s, done.
Resolving deltas: 100% (151/151), done.
/content/BLIP
It works when I use transformers==4.16.0
import sys
if 'google.colab' in sys.modules:
print('Running in Colab.')
!pip3 install transformers==4.16.0 timm==0.4.12 fairscale==0.4.4
Hi, i've encountered the same problem. when using transformers==4.16.0,
the install part indeed works, however the following code blocks reports error(eg.Image Captioning). Do you have any idea how to solve this? Thanks!
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
[/usr/local/lib/python3.8/dist-packages/transformers/file_utils.py](https://0tluz0k4htf-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230503-060127-RC00_529051665#) in _get_module(self, module_name)
2433 Tests if `x` is a `torch.Tensor`, `tf.Tensor`, `jaxlib.xla_extension.DeviceArray` or `np.ndarray`.
-> 2434 """
2435 if is_torch_fx_proxy(x):
27 frames
ImportError: cannot import name 'EntryNotFoundError' from 'transformers.file_utils' (/usr/local/lib/python3.8/dist-packages/transformers/file_utils.py)
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
RuntimeError: Failed to import transformers.tokenization_utils because of the following error (look up to see its traceback):
cannot import name 'EntryNotFoundError' from 'transformers.file_utils' (/usr/local/lib/python3.8/dist-packages/transformers/file_utils.py)
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
[/usr/local/lib/python3.8/dist-packages/transformers/file_utils.py](https://0tluz0k4htf-496ff2e9c6d22116-0-colab.googleusercontent.com/outputframe.html?vrz=colab-20230503-060127-RC00_529051665#) in _get_module(self, module_name)
2434 """
2435 if is_torch_fx_proxy(x):
-> 2436 return True
2437 if is_torch_available():
2438 import torch
RuntimeError: Failed to import transformers.onnx.config because of the following error (look up to see its traceback):
Failed to import transformers.tokenization_utils because of the following error (look up to see its traceback):
cannot import name 'EntryNotFoundError' from 'transformers.file_utils' (/usr/local/lib/python3.8/dist-packages/transformers/file_utils.py)
transformers==4.25.1
works!
thank you for sharing – this also worked for me :)
this version is not working transformers==4.28.1
list of versionshas a list of all the recent versions