jina-ai / discoart

🪩 Create Disco Diffusion artworks in one line
Other
3.84k stars 249 forks source link

ViT-B-32::laion2b_e16 not working in 0.7.7 #66

Closed adieyal closed 2 years ago

adieyal commented 2 years ago
from discoart import create
da = create(clip_models=["ViT-B-32::laion2b_e16"])

2022-07-21 16:42:34,092 - discoart - ERROR - Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper__index_select)
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/discoart/create.py", line 197, in create
    do_run(
  File "/usr/local/lib/python3.9/dist-packages/discoart/runner.py", line 94, in do_run
    txt = clip_model.encode_text(clip.tokenize(txt))
  File "/usr/local/lib/python3.9/dist-packages/open_clip/model.py", line 438, in encode_text
    x = self.token_embedding(text)  # [batch_size, n_ctx, d_model]
  File "/usr/local/lib/python3.9/dist-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/torch/nn/modules/sparse.py", line 158, in forward
    return F.embedding(
  File "/usr/local/lib/python3.9/dist-packages/torch/nn/functional.py", line 2199, in embedding
    return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument index in method wrapper__index_select)

!nvidia-smi

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 460.91.03    Driver Version: 460.91.03    CUDA Version: 11.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  RTX A4000           Off  | 00000000:00:05.0 Off |                  Off |
| 41%   48C    P8    17W / 140W |   3801MiB / 16117MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
+-----------------------------------------------------------------------------+
hanxiao commented 2 years ago

use 0.7.8