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

jina flow --uses flow.tmp.yml made a lot of errors #90

Open
mariepop13 opened this issue Aug 26, 2022 · 23 comments
Open

jina flow --uses flow.tmp.yml made a lot of errors #90

mariepop13 opened this issue Aug 26, 2022 · 23 comments

Comments

@mariepop13
Copy link

Here what I have.

I did what proposed In #1… nothing change…
IMG_0468
IMG_0468
IMG_0469
IMG_0470

after pip install --upgrade jaxlib
IMG_0471

Thanks for your time.

@mariepop13 mariepop13 changed the title jina flow --uses flow.tmp.yml jina flow --uses flow.tmp.yml made a lot of errors Aug 26, 2022
@AmericanPresidentJimmyCarter
Copy link
Contributor

@mariepop13 Please give me the output of these two commands: python --version and cat flow.tmp.yml.

@mariepop13
Copy link
Author

@AmericanPresidentJimmyCarter

paperspace@pspkgwgm9:~$ python3 --version
Python 3.8.10

paperspace@pspkgwgm9:~$ cat flow.tmp.yml
cat: flow.tmp.yml: No such file or directory

@AmericanPresidentJimmyCarter
Copy link
Contributor

OK, so python flow_parser.py did not run. Have you tried python3 flow_parser.py? If you are running outside of a virtualenv you will need to specify the python version.

@mariepop13
Copy link
Author

I had to reinstall jina by pip.
During the installation
ERROR: docker 6.0.0 has requirement requests>=2.26.0, but you'll have requests 2.22.0 which is incompatible.

Still the same error as first pic

than I tried again cat flow.tmp.yml

paperspace@pspkgwgm9:~/dalle-flow$ cat flow.tmp.yml
jtype: Flow
with:
env:
JINA_LOG_LEVEL: debug
monitoring: true
port: 51005
protocol: grpc
executors:

  • env:
    CUDA_VISIBLE_DEVICES: 0
    XLA_PYTHON_CLIENT_ALLOCATOR: platform
    name: dalle
    replicas: 1
    timeout_ready: -1
    uses: executors/dalle/config.yml
  • external: true
    host: demo-cas.jina.ai
    name: clip_encoder
    needs:
    • gateway
      port: 2096
      tls: true
      uses: jinahub+docker://CLIPTorchEncoder/latest-gpu
  • env:
    CUDA_VISIBLE_DEVICES: 0
    XLA_PYTHON_CLIENT_ALLOCATOR: platform
    name: diffusion
    needs:
    • clip_encoder
      replicas: 1
      timeout_ready: -1
      uses: executors/glid3/config.yml
  • external: true
    host: demo-cas.jina.ai
    name: rerank
    needs:
    • dalle
    • diffusion
      port: 2096
      tls: true
      uses: jinahub+docker://CLIPTorchEncoder/latest-gpu
      uses_requests:
      /: rank
  • env:
    CUDA_VISIBLE_DEVICES: 0
    name: upscaler
    uses: executors/swinir/config.yml
  • floating: true
    name: store
    uses: executors/store/config.yml

@AmericanPresidentJimmyCarter
Copy link
Contributor

OK, you are indeed running it outside a virtual environment. Do this if you're trying to run stable-diffusion, from the dalle/dalle-flow folder:

sudo apt-get install python3 python3-pip
sudo pip3 install virtualenv
python3 -m virtualenv env
source env/bin/activate && cd -
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
pip install numpy tqdm pytorch_lightning einops numpy omegaconf
pip install https://github.com/crowsonkb/k-diffusion/archive/master.zip
cd latent-diffusion && pip install -e . && cd -
cd stable-diffusion && pip install -e . && cd -
cd SwinIR && pip install -e . && cd -
cd glid-3-xl && pip install -e . && cd -

Run jina with stable diffusion by:

cd dalle-flow
python flow_parser.py --enable-stable-diffusion --disable-dalle-mega --disable-glid3xl
jina flow --uses flow.tmp.yml

@mariepop13
Copy link
Author

Hi, again
I was in

(env) paperspace@pspkgwgm9:~/dalle-flow/dalle/dalle-flow$ python flow_parser.py --enable-stable-diffusion --disable-dalle-mega --disable-glid3xl
python: can't open file 'flow_parser.py': [Errno 2] No such file or directory

Or I have to go in ~/dalle-flow/?

I was trying to install the discord-bot too.

@AmericanPresidentJimmyCarter
Copy link
Contributor

Can you confirm that your filesystem looks like this?

dalle/
 |
 |-- SwinIR/
 |-- dalle-flow/
 |-- glid-3-xl/
 |-- latent-diffusion/
 |-- stable-diffusion/

@mariepop13
Copy link
Author

Sure

I had to download from
https://github.com/CompVis/latent-diffusion
https://github.com/CompVis/stable-diffusion
Because your link in
https://github.com/AmericanPresidentJimmyCarter/dalle-flow/tree/stable-diffusion
Where dead as well

(git clone https://github.com/CompVis/latent-diffusio324n.git
git clone https://github.com/StableDiffusion/latent-diffusion.git)

So here what I have:
(env) paperspace@pspkgwgm9:~/dalle-flow/dalle$ ls
dalle-flow glid-3-xl latent-diffusion stable-diffusion SwinIR

@mariepop13
Copy link
Author

(env) paperspace@pspkgwgm9:~/dalle-flow$ ls
client.ipynb executors flow.tmp.yml LICENSE start.sh
dalle flow-jcloud.yml flow.yml README.md
Dockerfile flow_parser.py k8s_flow requirements.txt

versus

(env) paperspace@pspkgwgm9:~/dalle-flow/dalle/dalle-flow$ ls
client.ipynb env flow-jcloud.yml k8s_flow README.md
Dockerfile executors flow.yml LICENSE requirements.txt

@AmericanPresidentJimmyCarter
Copy link
Contributor

Ok, it's best to start over. Running these commands will fix your installation and put everything into the ~/dalle folder. Copy the weights somewhere else if you have already downloaded them.

rm -rf ~/dalle-flow/
cd ~
mkdir dalle && cd dalle
git clone https://github.com/jina-ai/dalle-flow.git
git clone https://github.com/jina-ai/SwinIR.git
git clone https://github.com/CompVis/latent-diffusio324n.git
git clone https://github.com/StableDiffusion/latent-diffusion.git
git clone https://github.com/jina-ai/glid-3-xl.git

cd ~/dalle/dalle-flow
python3 -m virtualenv env
source env/bin/activate && cd -
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116
pip install numpy tqdm pytorch_lightning einops numpy omegaconf
pip install https://github.com/crowsonkb/k-diffusion/archive/master.zip
cd latent-diffusion && pip install -e . && cd -
cd stable-diffusion && pip install -e . && cd -
cd SwinIR && pip install -e . && cd -
cd glid-3-xl && pip install -e . && cd -

Then put the weights into ~/dalle/stable-diffusion.

Finally,

cd ~/dalle/dalle-flow
python flow_parser.py --enable-stable-diffusion --disable-dalle-mega --disable-glid3xl
jina flow --uses flow.tmp.yml

@mariepop13
Copy link
Author

I am so sorry... doesnt work.
Why do I have


/home/paperspace/.local/bin/jina flow --uses
flow.yml
╭──────────────┬──────────────────────────────────╮
│     Argument │ Value                            │
├──────────────┼──────────────────────────────────┤
│          cli │ flow                             │
│          env │ None                             │
│      inspect │ COLLECT                          │
│   log-config │ default                          │
│         name │ None                             │
│        quiet │ False                            │
│  quiet-error │ False                            │
│         uses │ flow.yml                         │
│    workspace │ None                             │
│ workspace-id │ edf84112eb2f445d951de491c27a0ef5 │

And not
/home/<user>/.local/lib/python3.9/site-packages/jina/__main__.py flow --uses flow.yml

can it be the problem???

otherwise

(env) paperspace@pspkgwgm9:~/dalle/dalle-flow$ jina flow --uses flow.tmp.yml
RequestsDependencyWarning: urllib3 (1.26.12) or chardet (3.0.4) doesn't match a supported version! (raised from /usr/lib/python3/dist-packages/requests/__init__.py:89)
DeprecationWarning: 'urllib3.contrib.pyopenssl' module is deprecated and will be removed in a future release of urllib3 2.x. Read more in this issue: https://github.com/urllib3/urllib3/issues/2680 (raised from /usr/lib/python3/dist-packages/requests/__init__.py:95)

MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNNNNNNWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNNNNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNNNWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMWxxxxxxxxxOMMMMMNxxxxxxxxx0MMMMMKddddddxkKWMMMMMMMMMMMMXOxdddxONMMMM
MMMMMMMMMMMMXllllllllldMMMMM0lllllllllxMMMMMOllllllllllo0MMMMMMMM0olllllllllo0MM
MMMMMMMMMMMMXllllllllldMMMMM0lllllllllxMMMMMOlllllllllllloWMMMMMdllllllllllllldM
MMMMMMMMMMMMXllllllllldMMMMM0lllllllllxMMMMMOllllllllllllloMMMM0lllllllllllllllK
MMMMMMMMMMMMKllllllllldMMMMM0lllllllllxMMMMMOllllllllllllllKMMM0lllllllllllllllO
MMMMMMMMMMMMKllllllllldMMMMM0lllllllllxMMMMMOllllllllllllll0MMMMollllllllllllllO
MWOkkkkk0MMMKlllllllllkMMMMM0lllllllllxMMMMMOllllllllllllll0MMMMMxlllllllllllllO
NkkkkkkkkkMMKlllllllloMMMMMM0lllllllllxMMMMMOllllllllllllll0MMMMMMWOdolllllllllO
KkkkkkkkkkNMKllllllldMMMMMMMMWWWWWWWWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MOkkkkkkk0MMKllllldXMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMWX00KXMMMMXxk0XMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM


/home/paperspace/.local/bin/jina flow --uses
flow.tmp.yml
╭──────────────┬──────────────────────────────────╮
│     Argument │ Value                            │
├──────────────┼──────────────────────────────────┤
│          cli │ flow                             │
│          env │ None                             │
│      inspect │ COLLECT                          │
│   log-config │ default                          │
│         name │ None                             │
│        quiet │ False                            │
│  quiet-error │ False                            │
│         uses │ flow.tmp.yml                     │
│    workspace │ None                             │
│ workspace-id │ b93b245a44454b85acaf9780f31f2740 │
╰──────────────┴──────────────────────────────────╯
⠋ Waiting ... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/0 -:--:--CRITI… stable/rep-0@3066 can not load the executor from executors/stable/config.yml [08/26/22 19:12:35]
CRITI… upscaler/rep-0@3067 can not load the executor from                           [08/26/22 19:12:35]
       executors/swinir/config.yml
DEBUG  gateway/rep-0@3069 adding connection for deployment clip_encoder/heads/0 to  [08/26/22 19:12:35]
       grpcs://demo-cas.jina.ai:2096
DEBUG  store/rep-0@3068 <executor.DalleFlowStore object at 0x7fecb0a9f460> is       [08/26/22 19:12:35]
       successfully loaded!
DEBUG  gateway/rep-0@3069 adding connection for deployment stable/heads/0 to
       grpc://0.0.0.0:55035
DEBUG  gateway/rep-0@3069 adding connection for deployment rerank/heads/0 to
       grpcs://demo-cas.jina.ai:2096
DEBUG  gateway/rep-0@3069 adding connection for deployment upscaler/heads/0 to
       grpc://0.0.0.0:56296
DEBUG  gateway/rep-0@3069 adding connection for deployment store/heads/0 to
       grpc://0.0.0.0:64287
DEBUG  store/rep-0@3068 start listening on 0.0.0.0:64287
DEBUG  gateway/rep-0@3069 start server bound to 0.0.0.0:51005
DEBUG  store/rep-0@3057 ready and listening                                         [08/26/22 19:12:35]
DEBUG  gateway/rep-0@3057 ready and listening                                       [08/26/22 19:12:35]
⠸ Waiting stable upscaler summary... ━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━ 2/5 0:00:00ERROR  stable/rep-0@3066 ImportError('can not import module from                    [08/26/22 19:12:35]
       /home/paperspace/dalle/dalle-flow/executors/stable/executor.py') during
       <class 'jina.serve.runtimes.worker.WorkerRuntime'> initialization
        add "--quiet-error" to suppress the exception details
       ╭─────────────────── Traceback (most recent call last) ────────────────────╮
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/importer.py:128 │
       │ in _path_import                                                          │
       │                                                                          │
       │   125 │   │   spec = importlib.util.spec_from_file_location(spec_name, a │
       │   126 │   │   module = importlib.util.module_from_spec(spec)             │
       │   127 │   │   sys.modules[spec_name] = module                            │
       │ ❱ 128 │   │   spec.loader.exec_module(module)                            │
       │   129 │   except Exception as ex:                                        │
       │   130 │   │   raise ImportError(f'can not import module from {absolute_p │
       │   131                                                                    │
       │ <frozen importlib._bootstrap_external>:848 in exec_module                │
       │ <frozen importlib._bootstrap>:219 in _call_with_frames_removed           │
       │                                                                          │
       │ /home/paperspace/dalle/dalle-flow/executors/stable/executor.py:2 in      │
       │ <module>                                                                 │
       │                                                                          │
       │     1 import PIL                                                         │
       │ ❱   2 import k_diffusion as K                                            │
       │     3 import numpy as np                                                 │
       │     4 import os                                                          │
       │     5 import shutil                                                      │
       ╰──────────────────────────────────────────────────────────────────────────╯
       ModuleNotFoundError: No module named 'k_diffusion'

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

       ╭─────────────────── Traceback (most recent call last) ────────────────────╮
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/orchestrate/po… │
       │ in run                                                                   │
       │                                                                          │
       │    71 │                                                                  │
       │    72 │   try:                                                           │
       │    73 │   │   _set_envs()                                                │
       │ ❱  74 │   │   runtime = runtime_cls(                                     │
       │    75 │   │   │   args=args,                                             │
       │    76 │   │   )                                                          │
       │    77 │   except Exception as ex:                                        │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in __init__                                                              │
       │                                                                          │
       │    28 │   │   :param kwargs: keyword args                                │
       │    29 │   │   """                                                        │
       │    30 │   │   self._health_servicer = health.HealthServicer(experimental │
       │ ❱  31 │   │   super().__init__(args, **kwargs)                           │
       │    32 │                                                                  │
       │    33 │   async def async_setup(self):                                   │
       │    34 │   │   """                                                        │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in __init__                                                              │
       │                                                                          │
       │    66 │   │                                                              │
       │    67 │   │   self._setup_monitoring()                                   │
       │    68 │   │   send_telemetry_event(event='start', obj=self)              │
       │ ❱  69 │   │   self._loop.run_until_complete(self.async_setup())          │
       │    70 │                                                                  │
       │    71 │   def run_forever(self):                                         │
       │    72 │   │   """                                                        │
       │                                                                          │
       │ /usr/lib/python3.8/asyncio/base_events.py:616 in run_until_complete      │
       │                                                                          │
       │    613 │   │   if not future.done():                                     │
       │    614 │   │   │   raise RuntimeError('Event loop stopped before Future  │
       │    615 │   │                                                             │
       │ ❱  616 │   │   return future.result()                                    │
       │    617 │                                                                 │
       │    618 │   def stop(self):                                               │
       │    619 │   │   """Stop running the event loop.                           │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in async_setup                                                           │
       │                                                                          │
       │    57 │   │   # Keep this initialization order                           │
       │    58 │   │   # otherwise readiness check is not valid                   │
       │    59 │   │   # The DataRequestHandler needs to be started BEFORE the gr │
       │ ❱  60 │   │   self._data_request_handler = DataRequestHandler(           │
       │    61 │   │   │   self.args, self.logger, self.metrics_registry          │
       │    62 │   │   )                                                          │
       │    63 │   │   await self._async_setup_grpc_server()                      │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in __init__                                                              │
       │                                                                          │
       │    41 │   │   self.args.parallel = self.args.shards                      │
       │    42 │   │   self.logger = logger                                       │
       │    43 │   │   self._is_closed = False                                    │
       │ ❱  44 │   │   self._load_executor(metrics_registry)                      │
       │    45 │   │   self._init_monitoring(metrics_registry)                    │
       │    46 │                                                                  │
       │    47 │   def _init_monitoring(self, metrics_registry: Optional['Collect │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in _load_executor                                                        │
       │                                                                          │
       │    79 │   │   :param metrics_registry: Optional prometheus metrics regis │
       │       passed to the executor so that it can expose metrics               │
       │    80 │   │   """                                                        │
       │    81 │   │   try:                                                       │
       │ ❱  82 │   │   │   self._executor: BaseExecutor = BaseExecutor.load_confi │
       │    83 │   │   │   │   self.args.uses,                                    │
       │    84 │   │   │   │   uses_with=self.args.uses_with,                     │
       │    85 │   │   │   │   uses_metas=self.args.uses_metas,                   │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/jaml/__init__.… │
       │ in load_config                                                           │
       │                                                                          │
       │   727 │   │   │                                                          │
       │   728 │   │   │   if allow_py_modules:                                   │
       │   729 │   │   │   │   _extra_search_paths = extra_search_paths or []     │
       │ ❱ 730 │   │   │   │   load_py_modules(                                   │
       │   731 │   │   │   │   │   no_tag_yml,                                    │
       │   732 │   │   │   │   │   extra_search_paths=(_extra_search_paths + [os. │
       │   733 │   │   │   │   │   if s_path                                      │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/jaml/helper.py… │
       │ in load_py_modules                                                       │
       │                                                                          │
       │   271 │   _finditem(d)                                                   │
       │   272 │   if mod:                                                        │
       │   273 │   │   mod = [complete_path(m, extra_search_paths, raise_nonexist │
       │ ❱ 274 │   │   PathImporter.add_modules(*mod)                             │
       │   275                                                                    │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/importer.py:159 │
       │ in add_modules                                                           │
       │                                                                          │
       │   156 │   │   from jina.jaml.helper import complete_path                 │
       │   157 │   │                                                              │
       │   158 │   │   for m in not_python_module_paths:                          │
       │ ❱ 159 │   │   │   _path_import(complete_path(m))                         │
       │   160                                                                    │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/importer.py:130 │
       │ in _path_import                                                          │
       │                                                                          │
       │   127 │   │   sys.modules[spec_name] = module                            │
       │   128 │   │   spec.loader.exec_module(module)                            │
       │   129 │   except Exception as ex:                                        │
       │ ❱ 130 │   │   raise ImportError(f'can not import module from {absolute_p │
       │   131                                                                    │
       │   132                                                                    │
       │   133 class PathImporter:                                                │
       ╰──────────────────────────────────────────────────────────────────────────╯
       ImportError: can not import module from
       /home/paperspace/dalle/dalle-flow/executors/stable/executor.py
DEBUG  stable/rep-0@3066 process terminated
ERROR  upscaler/rep-0@3067 ImportError('can not import module from                  [08/26/22 19:12:35]
       /home/paperspace/dalle/dalle-flow/executors/swinir/executor.py') during
       <class 'jina.serve.runtimes.worker.WorkerRuntime'> initialization
        add "--quiet-error" to suppress the exception details
       ╭─────────────────── Traceback (most recent call last) ────────────────────╮
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/importer.py:128 │
       │ in _path_import                                                          │
       │                                                                          │
       │   125 │   │   spec = importlib.util.spec_from_file_location(spec_name, a │
       │   126 │   │   module = importlib.util.module_from_spec(spec)             │
       │   127 │   │   sys.modules[spec_name] = module                            │
       │ ❱ 128 │   │   spec.loader.exec_module(module)                            │
       │   129 │   except Exception as ex:                                        │
       │   130 │   │   raise ImportError(f'can not import module from {absolute_p │
       │   131                                                                    │
       │ <frozen importlib._bootstrap_external>:848 in exec_module                │
       │ <frozen importlib._bootstrap>:219 in _call_with_frames_removed           │
       │                                                                          │
       │ /home/paperspace/dalle/dalle-flow/executors/swinir/executor.py:8 in      │
       │ <module>                                                                 │
       │                                                                          │
       │    5                                                                     │
       │    6 from jina import Executor, DocumentArray, Document, requests        │
       │    7                                                                     │
       │ ❱  8 from dalle_flow_swin_ir.main_test_swinir import main as swin_ir_mai │
       │    9                                                                     │
       │   10 class SwinIRUpscaler(Executor):                                     │
       │   11 │   def __init__(self, swinir_path: str, **kwargs):                 │
       ╰──────────────────────────────────────────────────────────────────────────╯
       ModuleNotFoundError: No module named 'dalle_flow_swin_ir'

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

       ╭─────────────────── Traceback (most recent call last) ────────────────────╮
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/orchestrate/po… │
       │ in run                                                                   │
       │                                                                          │
       │    71 │                                                                  │
       │    72 │   try:                                                           │
       │    73 │   │   _set_envs()                                                │
       │ ❱  74 │   │   runtime = runtime_cls(                                     │
       │    75 │   │   │   args=args,                                             │
       │    76 │   │   )                                                          │
       │    77 │   except Exception as ex:                                        │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in __init__                                                              │
       │                                                                          │
       │    28 │   │   :param kwargs: keyword args                                │
       │    29 │   │   """                                                        │
       │    30 │   │   self._health_servicer = health.HealthServicer(experimental │
       │ ❱  31 │   │   super().__init__(args, **kwargs)                           │
       │    32 │                                                                  │
       │    33 │   async def async_setup(self):                                   │
       │    34 │   │   """                                                        │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in __init__                                                              │
       │                                                                          │
       │    66 │   │                                                              │
       │    67 │   │   self._setup_monitoring()                                   │
       │    68 │   │   send_telemetry_event(event='start', obj=self)              │
       │ ❱  69 │   │   self._loop.run_until_complete(self.async_setup())          │
       │    70 │                                                                  │
       │    71 │   def run_forever(self):                                         │
       │    72 │   │   """                                                        │
       │                                                                          │
       │ /usr/lib/python3.8/asyncio/base_events.py:616 in run_until_complete      │
       │                                                                          │
       │    613 │   │   if not future.done():                                     │
       │    614 │   │   │   raise RuntimeError('Event loop stopped before Future  │
       │    615 │   │                                                             │
       │ ❱  616 │   │   return future.result()                                    │
       │    617 │                                                                 │
       │    618 │   def stop(self):                                               │
       │    619 │   │   """Stop running the event loop.                           │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in async_setup                                                           │
       │                                                                          │
       │    57 │   │   # Keep this initialization order                           │
       │    58 │   │   # otherwise readiness check is not valid                   │
       │    59 │   │   # The DataRequestHandler needs to be started BEFORE the gr │
       │ ❱  60 │   │   self._data_request_handler = DataRequestHandler(           │
       │    61 │   │   │   self.args, self.logger, self.metrics_registry          │
       │    62 │   │   )                                                          │
       │    63 │   │   await self._async_setup_grpc_server()                      │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in __init__                                                              │
       │                                                                          │
       │    41 │   │   self.args.parallel = self.args.shards                      │
       │    42 │   │   self.logger = logger                                       │
       │    43 │   │   self._is_closed = False                                    │
       │ ❱  44 │   │   self._load_executor(metrics_registry)                      │
       │    45 │   │   self._init_monitoring(metrics_registry)                    │
       │    46 │                                                                  │
       │    47 │   def _init_monitoring(self, metrics_registry: Optional['Collect │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/serve/runtimes… │
       │ in _load_executor                                                        │
       │                                                                          │
       │    79 │   │   :param metrics_registry: Optional prometheus metrics regis │
       │       passed to the executor so that it can expose metrics               │
       │    80 │   │   """                                                        │
       │    81 │   │   try:                                                       │
       │ ❱  82 │   │   │   self._executor: BaseExecutor = BaseExecutor.load_confi │
       │    83 │   │   │   │   self.args.uses,                                    │
       │    84 │   │   │   │   uses_with=self.args.uses_with,                     │
       │    85 │   │   │   │   uses_metas=self.args.uses_metas,                   │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/jaml/__init__.… │
       │ in load_config                                                           │
       │                                                                          │
       │   727 │   │   │                                                          │
       │   728 │   │   │   if allow_py_modules:                                   │
       │   729 │   │   │   │   _extra_search_paths = extra_search_paths or []     │
       │ ❱ 730 │   │   │   │   load_py_modules(                                   │
       │   731 │   │   │   │   │   no_tag_yml,                                    │
       │   732 │   │   │   │   │   extra_search_paths=(_extra_search_paths + [os. │
       │   733 │   │   │   │   │   if s_path                                      │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/jaml/helper.py… │
       │ in load_py_modules                                                       │
       │                                                                          │
       │   271 │   _finditem(d)                                                   │
       │   272 │   if mod:                                                        │
       │   273 │   │   mod = [complete_path(m, extra_search_paths, raise_nonexist │
       │ ❱ 274 │   │   PathImporter.add_modules(*mod)                             │
       │   275                                                                    │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/importer.py:159 │
       │ in add_modules                                                           │
       │                                                                          │
       │   156 │   │   from jina.jaml.helper import complete_path                 │
       │   157 │   │                                                              │
       │   158 │   │   for m in not_python_module_paths:                          │
       │ ❱ 159 │   │   │   _path_import(complete_path(m))                         │
       │   160                                                                    │
       │                                                                          │
       │ /home/paperspace/.local/lib/python3.8/site-packages/jina/importer.py:130 │
       │ in _path_import                                                          │
       │                                                                          │
       │   127 │   │   sys.modules[spec_name] = module                            │
       │   128 │   │   spec.loader.exec_module(module)                            │
       │   129 │   except Exception as ex:                                        │
       │ ❱ 130 │   │   raise ImportError(f'can not import module from {absolute_p │
       │   131                                                                    │
       │   132                                                                    │
       │   133 class PathImporter:                                                │
       ╰──────────────────────────────────────────────────────────────────────────╯
       ImportError: can not import module from
       /home/paperspace/dalle/dalle-flow/executors/swinir/executor.py
DEBUG  upscaler/rep-0@3067 process terminated
DEBUG  stable/rep-0@3057 waiting for ready or shutdown signal from runtime          [08/26/22 19:12:35]
DEBUG  upscaler/rep-0@3057 waiting for ready or shutdown signal from runtime        [08/26/22 19:12:35]
DEBUG  upscaler/rep-0@3057 shutdown is is already set. Runtime will end gracefully
       on its own
DEBUG  stable/rep-0@3057 shutdown is is already set. Runtime will end gracefully on
       its own
DEBUG  upscaler/rep-0@3057 terminating the runtime process
DEBUG  stable/rep-0@3057 terminating the runtime process
DEBUG  upscaler/rep-0@3057 runtime process properly terminated
DEBUG  stable/rep-0@3057 runtime process properly terminated
DEBUG  upscaler/rep-0@3057 terminated
DEBUG  stable/rep-0@3057 terminated
DEBUG  upscaler/rep-0@3057 joining the process
DEBUG  stable/rep-0@3057 joining the process
DEBUG  upscaler/rep-0@3057 successfully joined the process
DEBUG  stable/rep-0@3057 successfully joined the process
ERROR  Flow@3057 Flow is aborted due to ['stable', 'upscaler'] can not be started.  [08/26/22 19:12:39]
DEBUG  gateway/rep-0@3057 waiting for ready or shutdown signal from runtime         [08/26/22 19:12:39]
DEBUG  gateway/rep-0@3057 terminate
DEBUG  gateway/rep-0@3057 terminating the runtime process
DEBUG  gateway/rep-0@3057 runtime process properly terminated
⠹ Waiting summary... ━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━ 2/5 0:00:04DEBUG  gateway/rep-0@3069 process terminated                                        [08/26/22 19:12:39]
DEBUG  gateway/rep-0@3057 terminated
DEBUG  gateway/rep-0@3057 joining the process
DEBUG  gateway/rep-0@3057 successfully joined the process
DEBUG  store/rep-0@3057 waiting for ready or shutdown signal from runtime           [08/26/22 19:12:39]
DEBUG  store/rep-0@3057 terminate
DEBUG  store/rep-0@3057 terminating the runtime process
⠹ Waiting summary... ━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━ 2/5 0:00:04DEBUG  store/rep-0@3068 cancel WorkerRuntime                                        [08/26/22 19:12:39]
DEBUG  store/rep-0@3057 runtime process properly terminated
⠹ Waiting summary... ━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━ 2/5 0:00:04DEBUG  store/rep-0@3068 stopped GRPC Server
DEBUG  store/rep-0@3068 cancel WorkerRuntime
DEBUG  store/rep-0@3068 stopped GRPC Server
DEBUG  store/rep-0@3068 process terminated                                          [08/26/22 19:12:39]
DEBUG  store/rep-0@3057 terminated
DEBUG  store/rep-0@3057 joining the process
DEBUG  store/rep-0@3057 successfully joined the process
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses (raised from /usr/lib/python3/dist-packages/apport/report.py:13)
Traceback (most recent call last):
  File "/home/paperspace/.local/bin/jina", line 8, in <module>
    sys.exit(main())
  File "/home/paperspace/.local/lib/python3.8/site-packages/jina_cli/__init__.py", line 143, in main
    getattr(api, args.cli.replace('-', '_'))(args)
  File "/home/paperspace/.local/lib/python3.8/site-packages/jina_cli/api.py", line 173, in flow
    with f:
  File "/home/paperspace/.local/lib/python3.8/site-packages/jina/orchestrate/flow/base.py", line 1405, in __enter__
    return self.start()
  File "/home/paperspace/.local/lib/python3.8/site-packages/jina/orchestrate/flow/builder.py", line 33, in arg_wrapper
    return func(self, *args, **kwargs)
  File "/home/paperspace/.local/lib/python3.8/site-packages/jina/orchestrate/flow/base.py", line 1461, in start
    self._wait_until_all_ready()
  File "/home/paperspace/.local/lib/python3.8/site-packages/jina/orchestrate/flow/base.py", line 1560, in _wait_until_all_ready
    raise RuntimeFailToStart
jina.excepts.RuntimeFailToStart

@AmericanPresidentJimmyCarter
Copy link
Contributor

AmericanPresidentJimmyCarter commented Aug 26, 2022

Are you in the virtual environment where you installed everything? It must be loaded with source env/bin/activate to use all the programs you installed into it.

cd ~/dalle/dalle-flow
source env/bin/activate
python flow_parser.py --enable-stable-diffusion --disable-dalle-mega --disable-glid3xl
jina flow --uses flow.tmp.yml

@mariepop13
Copy link
Author

I do.

Don't know if it can help.

(env) paperspace@pspkgwgm9:~/dalle/dalle-flow/env/bin$ ls
accelerate              convert-onnx-to-caffe2  markdown_py     pyrsa-sign    torchrun
accelerate-config       deactivate.nu           normalizer      pyrsa-verify  tqdm
accelerate-launch       f2py                    pip             python        wandb
activate                f2py3                   pip3            python3       wb
activate.csh            f2py3.8                 pip-3.8         python3.8     wheel
activate.fish           ftfy                    pip3.8          shortuuid     wheel3
activate.nu             google-oauthlib-tool    pygrun          skivi         wheel-3.8
activate.ps1            imageio_download_bin    pyrsa-decrypt   tensorboard   wheel3.8
activate_this.py        imageio_remove_bin      pyrsa-encrypt   tiff2fsspec
chardetect              jsonschema              pyrsa-keygen    tiffcomment
convert-caffe2-to-onnx  lsm2bin                 pyrsa-priv2pub  tifffile
(env) paperspace@pspkgwgm9:~/dalle/dalle-flow$ cat flow.tmp.yml
jtype: Flow
with:
  env:
    JINA_LOG_LEVEL: debug
  monitoring: true
  port: 51005
  protocol: grpc
executors:
- external: true
  host: demo-cas.jina.ai
  name: clip_encoder
  needs:
  - gateway
  port: 2096
  tls: true
  uses: jinahub+docker://CLIPTorchEncoder/latest-gpu
- env:
    CUDA_VISIBLE_DEVICES: 0
    XLA_PYTHON_CLIENT_ALLOCATOR: platform
  name: stable
  replicas: 1
  timeout_ready: -1
  uses: executors/stable/config.yml
- external: true
  host: demo-cas.jina.ai
  name: rerank
  needs:
  - stable
  port: 2096
  tls: true
  uses: jinahub+docker://CLIPTorchEncoder/latest-gpu
  uses_requests:
    /: rank
- env:
    CUDA_VISIBLE_DEVICES: 0
  name: upscaler
  uses: executors/swinir/config.yml
- floating: true
  name: store
  uses: executors/store/config.yml

@AmericanPresidentJimmyCarter
Copy link
Contributor

flow.tmp.yml Looks good. Can you cat ~/dalle for me? Jina crashed because it couldn't find the SwinIR or k-diffusion installations, it's like several of the packages weren't installed into the virtual environment.

@AmericanPresidentJimmyCarter
Copy link
Contributor

Sorry lol, it's been a long day. ls ~/dalle, which will list the directories.

@mariepop13
Copy link
Author

lol, thanks to make me feel more guilty

(env) paperspace@pspkgwgm9:~/dalle/dalle-flow$ ls ~/dalle
dalle-flow  glid-3-xl  latent-diffusion  stable-diffusion  SwinIR

@AmericanPresidentJimmyCarter
Copy link
Contributor

No, it's not you!

OK, you have all the right folders. Run these commands while inside the virtualenv (terminal prefixed with (env)):

cd ~/dalle/SwinIR
pip install -e .
cd ~/dalle/stable-diffusion
pip install -e .
pip install https://github.com/crowsonkb/k-diffusion/archive/master.zip

Then run jina again with

cd ~/dalle/dalle-flow
python flow_parser.py --enable-stable-diffusion --disable-dalle-mega --disable-glid3xl
jina flow --uses flow.tmp.yml

Did that work?

@mariepop13
Copy link
Author

Spoiler alert: no...

@AmericanPresidentJimmyCarter
Copy link
Contributor

At this point I am unsure what is the issue. However, would you like to try installing dalle-flow through docker? I have updated the README in the bot repo:

https://github.com/AmericanPresidentJimmyCarter/yasd-discord-bot#docker-installation-build-docker-image-yourself

If you follow that you can just run a docker image instead of having to install dalle-flow manually.

@mariepop13
Copy link
Author

Ya sure thanks again for your time, I will update you with the results if you want.

@AmericanPresidentJimmyCarter
Copy link
Contributor

Yes, it's always good to know if something works or does not. Unfortunately I am not sure why installing jina/dalle-flow normally is failing.

@ThrownLemon
Copy link

ThrownLemon commented Sep 2, 2022

@mariepop13 I ran into similer issues on ubuntu 22.04

In my case it was about this line:

from dalle_flow_swin_ir.main_test_swinir import main as swin_ir_main, get_model

As a workaround, swaping executor.py for the below version seemed to fix the errors for me, maybe worth a shot?
https://github.com/AmericanPresidentJimmyCarter/dalle-flow/blob/main/executors/swinir/executor.py

You may also have to delete your SwinIR dir and clone this version instead:
https://github.com/JingyunLiang/SwinIR

Also in your error log, its complaining about not finding module k_diffusion maybe try:
pip install git+https://github.com/crowsonkb/k-diffusion

@JoanFM
Copy link
Member

JoanFM commented Oct 11, 2022

Hey @mariepop13 ,

is this problem solved?

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

4 participants