Giter Site home page Giter Site logo

jina-ai / dalle-flow Goto Github PK

View Code? Open in Web Editor NEW
2.8K 55.0 211.0 113.79 MB

🌊 A Human-in-the-Loop workflow for creating HD images from text

Home Page: grpcs://dalle-flow.dev.jina.ai

Python 73.57% Jupyter Notebook 14.25% Dockerfile 11.07% Shell 1.11%
dalle generative-art human-in-the-loop jina neural-search openai swinir dalle-mega dalle-mini glid3

dalle-flow's Introduction

DALL·E Flow: A Human-in-the-loop workflow for creating HD images from text
A Human-in-the-loop? workflow for creating HD images from text

Open in Google Colab Docker Image Size (latest by date)

DALL·E Flow is an interactive workflow for generating high-definition images from text prompt. First, it leverages DALL·E-Mega, GLID-3 XL, and Stable Diffusion to generate image candidates, and then calls CLIP-as-service to rank the candidates w.r.t. the prompt. The preferred candidate is fed to GLID-3 XL for diffusion, which often enriches the texture and background. Finally, the candidate is upscaled to 1024x1024 via SwinIR.

DALL·E Flow is built with Jina in a client-server architecture, which gives it high scalability, non-blocking streaming, and a modern Pythonic interface. Client can interact with the server via gRPC/Websocket/HTTP with TLS.

Why Human-in-the-loop? Generative art is a creative process. While recent advances of DALL·E unleash people's creativity, having a single-prompt-single-output UX/UI locks the imagination to a single possibility, which is bad no matter how fine this single result is. DALL·E Flow is an alternative to the one-liner, by formalizing the generative art as an iterative procedure.

Usage

DALL·E Flow is in client-server architecture.

Updates

  • 🌟 2022/10/27 RealESRGAN upscalers have been added.
  • ⚠️ 2022/10/26 To use CLIP-as-service available at grpcs://api.clip.jina.ai:2096 (requires jina >= v3.11.0), you need first get an access token from here. See Use the CLIP-as-service for more details.
  • 🌟 2022/9/25 Automated CLIP-based segmentation from a prompt has been added.
  • 🌟 2022/8/17 Text to image for Stable Diffusion has been added. In order to use it you will need to agree to their ToS, download the weights, then enable the flag in docker or flow_parser.py.
  • ⚠️ 2022/8/8 Started using CLIP-as-service as an external executor. Now you can easily deploy your own CLIP executor if you want. There is a small breaking change as a result of this improvement, so please reopen the notebook in Google Colab.
  • ⚠️ 2022/7/6 Demo server migration to AWS EKS for better availability and robustness, server URL is now changing to grpcs://dalle-flow.dev.jina.ai. All connections are now with TLS encryption, please reopen the notebook in Google Colab.
  • ⚠️ 2022/6/25 Unexpected downtime between 6/25 0:00 - 12:00 CET due to out of GPU quotas. The new server now has 2 GPUs, add healthcheck in client notebook.
  • 2022/6/3 Reduce default number of images to 2 per pathway, 4 for diffusion.
  • 🐳 2022/6/21 A prebuilt image is now available on Docker Hub! This image can be run out-of-the-box on CUDA 11.6. Fix an upstream bug in CLIP-as-service.
  • ⚠️ 2022/5/23 Fix an upstream bug in CLIP-as-service. This bug makes the 2nd diffusion step irrelevant to the given texts. New Dockerfile proved to be reproducible on a AWS EC2 p2.x8large instance.
  • 2022/5/13b Removing TLS as Cloudflare gives 100s timeout, making DALLE Flow in usable Please reopen the notebook in Google Colab!.
  • 🔐 2022/5/13 New Mega checkpoint! All connections are now with TLS, Please reopen the notebook in Google Colab!.
  • 🐳 2022/5/10 A Dockerfile is added! Now you can easily deploy your own DALL·E Flow. New Mega checkpoint! Smaller memory-footprint, the whole Flow can now fit into one GPU with 21GB memory.
  • 🌟 2022/5/7 New Mega checkpoint & multiple optimization on GLID3: less memory-footprint, use ViT-L/14@336px from CLIP-as-service, steps 100->200.
  • 🌟 2022/5/6 DALL·E Flow just got updated! Please reopen the notebook in Google Colab!
    • Revised the first step: 16 candidates are generated, 8 from DALL·E Mega, 8 from GLID3-XL; then ranked by CLIP-as-service.
    • Improved the flow efficiency: the overall speed, including diffusion and upscaling are much faster now!

Gallery

a realistic photo of a muddy dogA scientist comparing apples and oranges, by Norman Rockwellan oil painting portrait of the regal Burger King posing with a WhopperEternal clock powered by a human cranium, artstationanother planet amazing landscapeThe Decline and Fall of the Roman Empire board game kickstarterA raccoon astronaut with the cosmos reflecting on the glass of his helmet dreaming of the stars, digital artA photograph of an apple that is a disco ball, 85 mm lens, studio lightinga cubism painting Donald trump happy cyberpunkoil painting of a hamster drinking tea outsideColossus of Rhodes by Max Ernstlandscape with great castle in middle of forestan medieval oil painting of Kanye west feels satisfied while playing chess in the style of ExpressionismAn oil pastel painting of an annoyed cat in a spaceshipdinosaurs at the brink of a nuclear disasterfantasy landscape with medieval cityGPU chip in the form of an avocado, digital arta giant rubber duck in the oceanPaddington bear as austrian emperor in antique black & white photographya rainy night with a superhero perched above a city, in the style of a comic bookA synthwave style sunset above the reflecting water of the sea, digital artan oil painting of ocean beach front in the style of Titianan oil painting of Klingon general in the style of Rubenscity, top view, cyberpunk, digital realistic artan oil painting of a medieval cyborg automaton made of magic parts and old steampunk mechanicsa watercolour painting of a top view of a pirate ship sailing on the cloudsa knight made of beautiful flowers and fruits by Rachel ruysch in the style of Syd braka 3D render of a rainbow colored hot air balloon flying above a reflective lakea teddy bear on a skateboard in Times Square cozy bedroom at nightan oil painting of monkey using computerthe diagram of a search machine invented by Leonardo da VinciA stained glass window of toucans in outer spacea campfire in the woods at night with the milky-way galaxy in the skyBionic killer robot made of AI scarab beetlesThe Hanging Gardens of Babylon in the middle of a city, in the style of Dalípainting oil of Izhevska hyper realistic photo of a marshmallow office chairfantasy landscape with cityocean beach front view in Van Gogh styleAn oil painting of a family reunited inside of an airport, digital artantique photo of a knight riding a T-Rexa top view of a pirate ship sailing on the cloudsan oil painting of a humanoid robot playing chess in the style of Matissea cubism painting of a cat dressed as French emperor Napoleona husky dog wearing a hat with sunglassesA mystical castle appears between the clouds in the style of Vincent di Fategolden gucci airpods realistic photo

Client

Open in Google Colab

Using client is super easy. The following steps are best run in Jupyter notebook or Google Colab.

You will need to install DocArray and Jina first:

pip install "docarray[common]>=0.13.5" jina

We have provided a demo server for you to play:

⚠️ Due to the massive requests, our server may be delay in response. Yet we are very confident on keeping the uptime high. You can also deploy your own server by following the instruction here.

server_url = 'grpcs://dalle-flow.dev.jina.ai'

Step 1: Generate via DALL·E Mega

Now let's define the prompt:

prompt = 'an oil painting of a humanoid robot playing chess in the style of Matisse'

Let's submit it to the server and visualize the results:

from docarray import Document

doc = Document(text=prompt).post(server_url, parameters={'num_images': 8})
da = doc.matches

da.plot_image_sprites(fig_size=(10,10), show_index=True)

Here we generate 24 candidates, 8 from DALLE-mega, 8 from GLID3 XL, and 8 from Stable Diffusion, this is as defined in num_images, which takes about ~2 minutes. You can use a smaller value if it is too long for you.

Step 2: Select and refinement via GLID3 XL

The 24 candidates are sorted by CLIP-as-service, with index-0 as the best candidate judged by CLIP. Of course, you may think differently. Notice the number in the top-left corner? Select the one you like the most and get a better view:

fav_id = 3
fav = da[fav_id]
fav.embedding = doc.embedding
fav.display()

Now let's submit the selected candidates to the server for diffusion.

diffused = fav.post(f'{server_url}', parameters={'skip_rate': 0.5, 'num_images': 36}, target_executor='diffusion').matches

diffused.plot_image_sprites(fig_size=(10,10), show_index=True)

This will give 36 images based on the selected image. You may allow the model to improvise more by giving skip_rate a near-zero value, or a near-one value to force its closeness to the given image. The whole procedure takes about ~2 minutes.

Step 3: Select and upscale via SwinIR

Select the image you like the most, and give it a closer look:

dfav_id = 34
fav = diffused[dfav_id]
fav.display()

Finally, submit to the server for the last step: upscaling to 1024 x 1024px.

fav = fav.post(f'{server_url}/upscale')
fav.display()

That's it! It is the one. If not satisfied, please repeat the procedure.

Btw, DocArray is a powerful and easy-to-use data structure for unstructured data. It is super productive for data scientists who work in cross-/multi-modal domain. To learn more about DocArray, please check out the docs.

Server

You can host your own server by following the instruction below.

Hardware requirements

DALL·E Flow needs one GPU with 21GB VRAM at its peak. All services are squeezed into this one GPU, this includes (roughly)

  • DALLE ~9GB
  • GLID Diffusion ~6GB
  • Stable Diffusion ~8GB (batch_size=4 in config.yml, 512x512)
  • SwinIR ~3GB
  • CLIP ViT-L/14-336px ~3GB

The following reasonable tricks can be used for further reducing VRAM:

It requires at least 50GB free space on the hard drive, mostly for downloading pretrained models.

High-speed internet is required. Slow/unstable internet may throw frustrating timeout when downloading models.

CPU-only environment is not tested and likely won't work. Google Colab is likely throwing OOM hence also won't work.

Server architecture

If you have installed Jina, the above flowchart can be generated via:

# pip install jina
jina export flowchart flow.yml flow.svg

Stable Diffusion weights

If you want to use Stable Diffusion, you will first need to register an account on the website Huggingface and agree to the terms and conditions for the model. After logging in, you can find the version of the model required by going here:

CompVis / sd-v1-5-inpainting.ckpt

Under the Download the Weights section, click the link for sd-v1-x.ckpt. The latest weights at the time of writing are sd-v1-5.ckpt.

DOCKER USERS: Put this file into a folder named ldm/stable-diffusion-v1 and rename it model.ckpt. Follow the instructions below carefully because SD is not enabled by default.

NATIVE USERS: Put this file into dalle/stable-diffusion/models/ldm/stable-diffusion-v1/model.ckpt after finishing the rest of the steps under "Run natively". Follow the instructions below carefully because SD is not enabled by default.

Run in Docker

Prebuilt image

We have provided a prebuilt Docker image that can be pull directly.

docker pull jinaai/dalle-flow:latest

Build it yourself

We have provided a Dockerfile which allows you to run a server out of the box.

Our Dockerfile is using CUDA 11.6 as the base image, you may want to adjust it according to your system.

git clone https://github.com/jina-ai/dalle-flow.git
cd dalle-flow

docker build --build-arg GROUP_ID=$(id -g ${USER}) --build-arg USER_ID=$(id -u ${USER}) -t jinaai/dalle-flow .

The building will take 10 minutes with average internet speed, which results in a 18GB Docker image.

Run container

To run it, simply do:

docker run -p 51005:51005 \
  -it \
  -v $HOME/.cache:/home/dalle/.cache \
  --gpus all \
  jinaai/dalle-flow

Alternatively, you may also run with some workflows enabled or disabled to prevent out-of-memory crashes. To do that, pass one of these environment variables:

DISABLE_DALLE_MEGA
DISABLE_GLID3XL
DISABLE_SWINIR
ENABLE_STABLE_DIFFUSION
ENABLE_CLIPSEG
ENABLE_REALESRGAN

For example, if you would like to disable GLID3XL workflows, run:

docker run -e DISABLE_GLID3XL='1' \
  -p 51005:51005 \
  -it \
  -v $HOME/.cache:/home/dalle/.cache \
  --gpus all \
  jinaai/dalle-flow
  • The first run will take ~10 minutes with average internet speed.
  • -v $HOME/.cache:/root/.cache avoids repeated model downloading on every docker run.
  • The first part of -p 51005:51005 is your host public port. Make sure people can access this port if you are serving publicly. The second par of it is the port defined in flow.yml.
  • If you want to use Stable Diffusion, it must be enabled manually with the ENABLE_STABLE_DIFFUSION.
  • If you want to use clipseg, it must be enabled manually with the ENABLE_CLIPSEG.
  • If you want to use RealESRGAN, it must be enabled manually with the ENABLE_REALESRGAN.

Special instructions for Stable Diffusion and Docker

Stable Diffusion may only be enabled if you have downloaded the weights and make them available as a virtual volume while enabling the environmental flag (ENABLE_STABLE_DIFFUSION) for SD.

You should have previously put the weights into a folder named ldm/stable-diffusion-v1 and labeled them model.ckpt. Replace YOUR_MODEL_PATH/ldm below with the path on your own system to pipe the weights into the docker image.

docker run -e ENABLE_STABLE_DIFFUSION="1" \
  -e DISABLE_DALLE_MEGA="1" \
  -e DISABLE_GLID3XL="1" \
  -p 51005:51005 \
  -it \
  -v YOUR_MODEL_PATH/ldm:/dalle/stable-diffusion/models/ldm/ \
  -v $HOME/.cache:/home/dalle/.cache \
  --gpus all \
  jinaai/dalle-flow

You should see the screen like following once running:

Note that unlike running natively, running inside Docker may give less vivid progressbar, color logs, and prints. This is due to the limitations of the terminal in a Docker container. It does not affect the actual usage.

Run natively

Running natively requires some manual steps, but it is often easier to debug.

Clone repos

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 --branch v0.0.15 https://github.com/AmericanPresidentJimmyCarter/stable-diffusion.git
git clone https://github.com/CompVis/latent-diffusion.git
git clone https://github.com/jina-ai/glid-3-xl.git
git clone https://github.com/timojl/clipseg.git

You should have the following folder structure:

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

Install auxiliary repos

cd 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
pip install git+https://github.com/AmericanPresidentJimmyCarter/[email protected]
pip install basicsr facexlib gfpgan
pip install realesrgan
pip install https://github.com/AmericanPresidentJimmyCarter/xformers-builds/raw/master/cu116/xformers-0.0.14.dev0-cp310-cp310-linux_x86_64.whl && \
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 -
cd clipseg && pip install -e . && cd -

There are couple models we need to download for GLID-3-XL if you are using that:

cd glid-3-xl
wget https://dall-3.com/models/glid-3-xl/bert.pt
wget https://dall-3.com/models/glid-3-xl/kl-f8.pt
wget https://dall-3.com/models/glid-3-xl/finetune.pt
cd -

Both clipseg and RealESRGAN require you to set a correct cache folder path, typically something like $HOME/.

Install flow

cd dalle-flow
pip install -r requirements.txt
pip install jax~=0.3.24

Start the server

Now you are under dalle-flow/, run the following command:

# Optionally disable some generative models with the following flags when
# using flow_parser.py:
# --disable-dalle-mega
# --disable-glid3xl
# --disable-swinir
# --enable-stable-diffusion
python flow_parser.py
jina flow --uses flow.tmp.yml

You should see this screen immediately:

On the first start it will take ~8 minutes for downloading the DALL·E mega model and other necessary models. The proceeding runs should only take ~1 minute to reach the success message.

When everything is ready, you will see:

Congrats! Now you should be able to run the client.

You can modify and extend the server flow as you like, e.g. changing the model, adding persistence, or even auto-posting to Instagram/OpenSea. With Jina and DocArray, you can easily make DALL·E Flow cloud-native and ready for production.

Use the CLIP-as-service

To reduce the usage of vRAM, you can use the CLIP-as-service as an external executor freely available at grpcs://api.clip.jina.ai:2096.
First, make sure you have created an access token from console website, or CLI as following

jina auth token create <name of PAT> -e <expiration days>

Then, you need to change the executor related configs (host, port, external, tls and grpc_metadata) from flow.yml.

...
  - name: clip_encoder
    uses: jinahub+docker://CLIPTorchEncoder/latest-gpu
    host: 'api.clip.jina.ai'
    port: 2096
    tls: true
    external: true
    grpc_metadata:
      authorization: "<your access token>"
    needs: [gateway]
...
  - name: rerank
    uses: jinahub+docker://CLIPTorchEncoder/latest-gpu
    host: 'api.clip.jina.ai'
    port: 2096
    uses_requests:
      '/': rank
    tls: true
    external: true
    grpc_metadata:
      authorization: "<your access token>"
    needs: [dalle, diffusion]

You can also use the flow_parser.py to automatically generate and run the flow with using the CLIP-as-service as external executor:

python flow_parser.py --cas-token "<your access token>'
jina flow --uses flow.tmp.yml

⚠️ grpc_metadata is only available after Jina v3.11.0. If you are using an older version, please upgrade to the latest version.

Now, you can use the free CLIP-as-service in your flow.

Support

Join Us

DALL·E Flow is backed by Jina AI and licensed under Apache-2.0. We are actively hiring AI engineers, solution engineers to build the next neural search ecosystem in open-source.

dalle-flow's People

Contributors

alaeddine-13 avatar alexcg1 avatar americanpresidentjimmycarter avatar andrei997 avatar delgermurun avatar foomonkey93 avatar hanxiao avatar joanfm avatar matrach avatar numb3r3 avatar pingren avatar wildermuthn avatar winstonww avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dalle-flow's Issues

Docker Container Won't Run "error waiting for container: context canceled"

Running Ubuntu 20.04 with an RTX 3090.

Docker container builds successfully, but will not run.

Successfully built 0ec2f71b358c
Successfully tagged jinaai/dalle-flow:latest
dalle-flow$ docker run -p 51005:51005 -v $HOME/.cache:/root/.cache --gpus all jinaai/dalle-flow
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0000] error waiting for container: context canceled

Calling Upscale from Colab is throwing an error

I tried upscaling my images but they always stay at 250x250 and not at 1024x1024.
Server side error:

ERROR  upscaler/rep-0@42                                 
       FileNotFoundError('`../SwinIR/results/swinir_real_sr…                    
       is not a URL or a valid local path')  
    FileNotFoundError:                                                       
       `../SwinIR/results/swinir_real_sr_x4_large/ac3266c0f…                    
       is not a URL or a valid local path   

Server on Colab Pro

According to the README.md file:

"DALL·E Flow needs one GPU with 21GB memory at its peak. All services are squeezed into this one GPU.
...
CPU-only environment is not tested and likely won't work. Google Colab is likely throwing OOM hence also won't work."

I'm planning to run server on the Colab Pro, which can go up to 36 GB of RAM. Before buying the paid subscription, has anyone tried and run the server successfully?

How to select either DALLE-mega or GLID3 XL, but not both.

The documents details that Dalle-Flow draws images from both DALLE-mega and GLID3 XL, such that the number of images returned are always double 'num_images'.

This is fine as you can select whatever image to store, however, if you are computing 100 images or 1000 images, then it becomes a significant computational waste when you recognize, depending on the prompt, that either DALLE-mega or GLID3 XL yields consistently poor results.

How do you change it such that only DALLE-mega or GlLID3 XL is selecting for synthesis?

For reference, this is the line that generates your docarrays containing the image urls. Document(text=prompt).post(server_url, parameters={'num_images': 2}).matches

Cannot connect to dalle when run in docker

Hello, thanks for sharing this wonderful project.

I had a problem there, I tried to run it in docker and access it locally. The docker build and run process is smooth, but when I started the client and tried to access it locally, this error occurs:
ConnectionError: failed to connect to all addresses |Gateway: Communication error with deployment at address 0.0.0.0:49336. Head or worker may be down.
I checked the port and see it should be the port of dalle as:
gateway/rep-0@60 adding connection for deployment dalle/heads/0 to grpc://0.0.0.0:49336

Any idea on how I could fix this? Thank you so much.

server is down i think, error message below

ERROR GRPCClient@60 gRPC error: StatusCode.UNAVAILABLE failed to connect [06/25/22 02:32:40]
to all addresses
The ongoing request is terminated as the server is not available
or closed already.
Exception in thread Thread-21:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/dist-packages/jina/helper.py", line 1292, in run
self.result = asyncio.run(func(*args, **kwargs))
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "/usr/local/lib/python3.7/dist-packages/jina/clients/mixin.py", line 163, in _get_results
async for resp in c._get_results(*args, **kwargs):
File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 115, in _get_results
raise ConnectionError(my_details) from None
ConnectionError: failed to connect to all addresses


AttributeError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/jina/helper.py in run_async(func, *args, **kwargs)
1306 try:
-> 1307 return thread.result
1308 except AttributeError:

AttributeError: '_RunThread' object has no attribute 'result'

During handling of the above exception, another exception occurred:

BadClient Traceback (most recent call last)
7 frames
in time(self, line, cell, local_ns)

in ()

/usr/local/lib/python3.7/dist-packages/jina/helper.py in run_async(func, *args, **kwargs)
1310
1311 raise BadClient(
-> 1312 'something wrong when running the eventloop, result can not be retrieved'
1313 )
1314 else:

BadClient: something wrong when running the eventloop, result can not be retrieved

"Diffusion" executer not starting

Hello,
I am trying to run the dalle-flow server container on OpenShift with an Nvidia A40 GPU.
After waiting 10 minutes for dalle and diffusion, the diffusion executer terminates with a timeout.
I have tried the latest container image and also tried installing the latest version manually inside the container image.
Another problem is that there is not a single error or debug message coming from the diffusion executer.

Does anyone have the same problem, or any idea how I can debug this?
Thank you very much.

Colab notebook running forever

Was working perfectly yesterday morning, but this code block runs forever with no output:
%%time

from docarray import Document

da = Document(text=prompt).post(server_url, parameters={'num_images': 8}).matches

da.plot_image_sprites(fig_size=(10,10), show_index=True)

CUDA_ERROR_OUT_OF_MEMORY

How much memory does this need? I have a 3090 and 32GB ram. Drives have plenty of free space as well.

2022-06-28 17:20:05.773805: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:05.775033: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:05.911223: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 966367744 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:05.911295: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 966367744
2022-06-28 17:20:06.059801: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 869731072 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:06.059870: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 869731072
2022-06-28 17:20:06.205143: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 782758144 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:06.205272: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 782758144
2022-06-28 17:20:06.341728: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 704482304 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:06.341805: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 704482304
2022-06-28 17:20:06.482334: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 634034176 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:06.482408: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 634034176
2022-06-28 17:20:06.678511: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 570630912 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:06.678588: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 570630912
2022-06-28 17:20:06.791399: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 513568000 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:06.791463: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 513568000
2022-06-28 17:20:06.903232: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 462211328 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:06.903335: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 462211328
2022-06-28 17:20:07.017696: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 415990272 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:07.017815: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 415990272
2022-06-28 17:20:07.127174: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 374391296 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:07.127235: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 374391296
2022-06-28 17:20:07.242641: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 336952320 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:07.242713: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 336952320
2022-06-28 17:20:07.378882: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 303257088 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:07.378941: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 303257088
2022-06-28 17:20:07.497099: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 272931584 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:07.497188: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 272931584
2022-06-28 17:20:07.620745: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 245638656 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:07.620823: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 245638656
2022-06-28 17:20:07.861618: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 221074944 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:07.861732: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 221074944
2022-06-28 17:20:08.124513: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:08.124681: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:08.360486: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:08.360588: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:08.698690: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:08.698760: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:08.913261: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:08.913364: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:09.183035: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:09.183165: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:09.475952: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:09.476049: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:09.836381: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:09.836518: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:10.069211: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:10.069331: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:10.375444: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:10.375574: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:10.638628: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:10.638805: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:10.929819: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:10.929932: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:11.168446: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:11.168513: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:11.335792: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:11.335876: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:11.527182: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:11.527245: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:11.654251: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:11.654320: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:11.884727: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:11.884821: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:12.039273: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:12.039340: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:12.272328: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:12.272510: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824
2022-06-28 17:20:12.512926: E external/org_tensorflow/tensorflow/stream_executor/cuda/cuda_driver.cc:802] failed to alloc 1073741824 bytes on host: CUDA_ERROR_OUT_OF_MEMORY: out of memory
2022-06-28 17:20:12.513009: W external/org_tensorflow/tensorflow/core/common_runtime/device/device_host_allocator.h:46] could not allocate pinned host memory of size: 1073741824

Docker image connecting to demo-cas.jina.ai?

After several restarts I finally got the docker image to run locally on my machine. It was my impression that this image is supposed to be fully self-contained, but looking at the logs it reports:

diffusion/rep-0@24 connected to demo-cas.jina.ai:2096

Which seems to be set in flow.yml

So my question is whether this service is already provided by the docker image and this is just an oversight in the provided config file that it does not get used (since the docs suggest that) or if I have to run a dedicated clip-as-service instance if I want to avoid having to rely on external services?

Executor Failed Running (Exit Code 100)

I get the following error when running docker build -t jinaai/dalle-flow .

I tried rm -rf on dalle-flow. I'm on a Silicon Mac (arm64) and suspect the packages are only available for amd64.

Anybody else had any luck building the docker container on Mac silicon?

#10 103.8 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#10 103.8 
#10 103.8 Reading package lists...
#10 104.3 Building dependency tree...
#10 104.4 Reading state information...
#10 104.5 The following NEW packages will be installed:
#10 104.5   libcudnn8:amd64
#10 106.7 0 upgraded, 1 newly installed, 0 to remove and 27 not upgraded.
#10 106.7 Need to get 0 B/421 MB of archives.
#10 106.7 After this operation, 1253 MB of additional disk space will be used.
#10 106.7 Get:1 /dalle/libcudnn8_8.4.0.27-1+cuda11.6_amd64.deb libcudnn8 amd64 8.4.0.27-1+cuda11.6 [421 MB]
#10 106.7 debconf: delaying package configuration, since apt-utils is not installed
#10 106.8 dpkg: error processing archive /dalle/libcudnn8_8.4.0.27-1+cuda11.6_amd64.deb (--unpack):
#10 106.8  package architecture (amd64) does not match system (arm64)
#10 106.8 Errors were encountered while processing:
#10 106.8  /dalle/libcudnn8_8.4.0.27-1+cuda11.6_amd64.deb
#10 106.8 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
executor failed running [/bin/sh -c wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/libcudnn8_8.4.0.27-1+cuda11.6_amd64.deb     && apt install ./libcudnn8_8.4.0.27-1+cuda11.6_amd64.deb]: exit code: 100

DALL-E Mega taking forever (tstate-lock?)

Hey there!

Thanks for sharing the project. After updating dependencies, my run of the Colab gets stuck on step 1 trying to get 8 candidates from DALL-E Mega and GLID3 XL.

image

Any suggestions?

Failed to connect

Generating images currently doesn't seem to work.
When running the cell

%%time

from docarray import Document

da = Document(text=prompt).post(server_url, parameters={'num_images': 8}).matches

da.plot_image_sprites(fig_size=(10,10), show_index=True)

I get the following error:

ERROR  GRPCClient@60 gRPC error: StatusCode.UNAVAILABLE failed to connect [05/12/22 22:12:59]
       to all addresses                                                                      
       the ongoing request is terminated as the server is not available                      
       or closed already                                                                     
Exception in thread Thread-11:
Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/dist-packages/jina/helper.py", line 1311, in run
    self.result = asyncio.run(func(*args, **kwargs))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/mixin.py", line 147, in _get_results
    async for resp in c._get_results(*args, **kwargs):
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 128, in _get_results
    raise e
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 95, in _get_results
    raise rpc_ex
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 65, in _get_results
    compression.lower(), grpc.Compression.NoCompression
  File "/usr/local/lib/python3.7/dist-packages/grpc/aio/_call.py", line 326, in _fetch_stream_responses
    await self._raise_for_status()
  File "/usr/local/lib/python3.7/dist-packages/grpc/aio/_call.py", line 237, in _raise_for_status
    self._cython_call.status())
grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "failed to connect to all addresses"
	debug_error_string = "{"created":"@1652393579.737216803","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3217,"referenced_errors":[{"created":"@1652393579.737215929","description":"failed to connect to all addresses","file":"src/core/lib/transport/error_utils.cc","file_line":165,"grpc_status":14}]}"
>

╭──────────────────────────── Traceback (most recent call last) ────────────────────────────╮
│ /usr/local/lib/python3.7/dist-packages/jina/helper.py:1326 in run_async                   │
│                                                                                           │
│   1323 │   │   │   thread.start()                                                         │
│   1324 │   │   │   thread.join()                                                          │
│   1325 │   │   │   try:                                                                   │
│ ❱ 1326 │   │   │   │   return thread.result                                               │
│   1327 │   │   │   except AttributeError:                                                 │
│   1328 │   │   │   │   from jina.excepts import BadClient                                 │
│   1329                                                                                    │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: '_RunThread' object has no attribute 'result'

During handling of the above exception, another exception occurred:

╭──────────────────────────── Traceback (most recent call last) ────────────────────────────╮
│ /usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py:2882 in run_code  │
│                                                                                           │
│   2879 │   │   │   try:                                                                   │
│   2880 │   │   │   │   self.hooks.pre_run_code_hook()                                     │
│   2881 │   │   │   │   #rprint('Running code', repr(code_obj)) # dbg                      │
│ ❱ 2882 │   │   │   │   exec(code_obj, self.user_global_ns, self.user_ns)                  │
│   2883 │   │   │   finally:                                                               │
│   2884 │   │   │   │   # Reset our crash handler in place                                 │
│   2885 │   │   │   │   sys.excepthook = old_excepthook                                    │
│ <ipython-input-4-c8bf11265368>:1 in <module>                                              │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py:2117 in           │
│ run_cell_magic                                                                            │
│                                                                                           │
│   2114 │   │   │   stack_depth = 2                                                        │
│   2115 │   │   │   magic_arg_s = self.var_expand(line, stack_depth)                       │
│   2116 │   │   │   with self.builtin_trap:                                                │
│ ❱ 2117 │   │   │   │   result = fn(magic_arg_s, cell)                                     │
│   2118 │   │   │   return result                                                          │
│   2119 │                                                                                  │
│   2120 │   def find_line_magic(self, magic_name):                                         │
│ <decorator-gen-53>:2 in time                                                              │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/magic.py:188 in <lambda>              │
│                                                                                           │
│   185 │   # This is a closure to capture the magic_kind.  We could also use a class,      │
│   186 │   # but it's overkill for just that one bit of state.                             │
│   187 │   def magic_deco(arg):                                                            │
│ ❱ 188 │   │   call = lambda f, *a, **k: f(*a, **k)                                        │
│   189 │   │                                                                               │
│   190 │   │   if callable(arg):                                                           │
│   191 │   │   │   # "Naked" decorator call (just @foo, no args)                           │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/magics/execution.py:1193 in time      │
│                                                                                           │
│   1190 │   │   │   end = clock2()                                                         │
│   1191 │   │   else:                                                                      │
│   1192 │   │   │   st = clock2()                                                          │
│ ❱ 1193 │   │   │   exec(code, glob, local_ns)                                             │
│   1194 │   │   │   end = clock2()                                                         │
│   1195 │   │   │   out = None                                                             │
│   1196 │   │   wall_end = wtime()                                                         │
│ <timed exec>:4 in <module>                                                                │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/docarray/document/mixins/sugar.py:92 in post       │
│                                                                                           │
│   89 │   │   from ... import DocumentArray                                                │
│   90 │   │                                                                                │
│   91 │   │   _tmp = DocumentArray(self)                                                   │
│ ❱ 92 │   │   return _tmp.post(*args, **kwargs)[0]                                         │
│   93                                                                                      │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/docarray/array/mixins/post.py:85 in post           │
│                                                                                           │
│   82 │   │   │   │   show_progress=show_progress,                                         │
│   83 │   │   │   │   request_size=batch_size,                                             │
│   84 │   │   │   │   parameters=parameters,                                               │
│ ❱ 85 │   │   │   │   **kwargs,                                                            │
│   86 │   │   │   )                                                                        │
│   87 │   │   else:                                                                        │
│   88 │   │   │   raise ValueError(f'unsupported scheme: {r.scheme}')                      │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/jina/clients/mixin.py:166 in post                  │
│                                                                                           │
│   163 │   │   │   target_executor=target_executor,                                        │
│   164 │   │   │   parameters=parameters,                                                  │
│   165 │   │   │   request_size=request_size,                                              │
│ ❱ 166 │   │   │   **kwargs,                                                               │
│   167 │   │   )                                                                           │
│   168 │                                                                                   │
│   169 │   # ONLY CRUD, for other request please use `.post`                               │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/jina/helper.py:1331 in run_async                   │
│                                                                                           │
│   1328 │   │   │   │   from jina.excepts import BadClient                                 │
│   1329 │   │   │   │                                                                      │
│   1330 │   │   │   │   raise BadClient(                                                   │
│ ❱ 1331 │   │   │   │   │   'something wrong when running the eventloop, result can not be │
│   1332 │   │   │   │   )                                                                  │
│   1333 │   │   else:                                                                      │
│   1334                                                                                    │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
BadClient: something wrong when running the eventloop, result can not be retrieved

Can not generate 36 diffusion pic

Hi,
In the markdown, for the below code it says:
`diffused = fav.post(f'{server_url}', parameters={'skip_rate': 0.5, 'num_images': 36}, target_executor='diffusion').matches

diffused.plot_image_sprites(fig_size=(10,10), show_index=True)`
"This will give 36 images based on the selected image. You may allow the model to improvise more by giving skip_rate a near-zero value, or a near-one value to force its closeness to the given image. The whole procedure takes about ~2 minutes."

But whatever num_images I tried (such as 36), it only generate 9 pics. Is that a bug?
Thanks
Charles

Docker error

I have this problem running docker with command:
docker run -p 51005:51005 -v $HOME/.cache:/root/.cache --gpus all jinaai/dalle-flow
on aws g5.xlarge with Deep Learning AMI (Amazon Linux 2) Version 61.2

I have done lot of experiment fixing many small problems but now I'm not able to figure out how to go forward.
In any case thanks a lot for this wonderful project

SERVER:
Done. 0:0:0
device count: 1
DEBUG dalle/rep-0@12 start listening on 0.0.0.0:60127 [05/23/22 08:25:29]
DEBUG dalle/rep-0@ 1 ready and listening [05/23/22 08:25:29]

╭───── 🎉 Flow is ready to serve! ──────╮
│ 🔗 Protocol GRPC │
│ 🏠 Local 0.0.0.0:51005 │
│ 🔒 Private 172.17.0.2:51005 │
│ 🌍 Public 54.161.222.71:51005 │
╰───────────────────────────────────────╯

DEBUG gateway/rep-0@18 GRPC call failed with code [05/23/22 08:26:08]
StatusCode.UNAVAILABLE, retry attempt 1/3. Trying
next replica, if available.
DEBUG gateway/rep-0@18 GRPC call failed with code
StatusCode.UNAVAILABLE, retry attempt 1/3. Trying
next replica, if available.
DEBUG gateway/rep-0@18 GRPC call failed with code
StatusCode.UNAVAILABLE, retry attempt 2/3. Trying
next replica, if available.
DEBUG dalle/rep-0@12 recv DataRequest at / with id: [05/23/22 08:26:08]
3dfaebf6ef3e49a3977dd7dfe9eb6b27
DEBUG gateway/rep-0@18 GRPC call failed with code
StatusCode.UNAVAILABLE, retry attempt 2/3. Trying
next replica, if available.
DEBUG gateway/rep-0@18 GRPC call failed, retries exhausted
DEBUG gateway/rep-0@18 GRPC call failed, retries exhausted
ERROR gateway/rep-0@18 Error while getting responses from [05/23/22 08:26:08]
deployments: failed to connect to all addresses
|Gateway: Communication error with deployment at
address(es) 0.0.0.0:50029. Head or worker(s) may be
down.

CLIENT
ERROR GRPCClient@6813 gRPC error: StatusCode.UNAVAILABLE failed to connect to all addresses |Gateway: [05/23/2022 08:26:08 AM]
Communication error with deployment at address(es) 0.0.0.0:50029. Head or worker(s) may be down.
The ongoing request is terminated as the server is not available or closed already.

Installing locally taking mysteriously long

I am having a problem with the final code in the installation process:

jina flow --uses flow.yml

After running that in the console, the progress meter makes its way up to 5/6 before stalling for way too long. I've attached an image of what it looks like for me right now. Any way to fix this? There are no console errors and I am on a Mac with an M1 chip if that helps.

Screen Shot 2022-06-24 at 5 16 37 PM

Above you can see that It's taken 37 minutes on just the 5th step alone.

Problem downloading artifact-mega-1-fp16:latest inside docker

Ok, i'm running Arch with a RTX 2060 on a laptop and have persistant issue getting the docker-image to boot properly. It gets stuck downloading the artifact and times out after 10 minutes

Currently the logs are as follows

[jechto@ArchLinuxPC dalle-flow]$ docker run -p 51005:51005 -v $HOME/.cache:/home/dalle/.cache --gpus all jinaai/dalle-flow

/usr/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 │ fc0ab1fe623e49cfbd8e6df97dad1f32 │
╰──────────────┴──────────────────────────────────╯
UserWarning: ignored unknown argument: ['--needs']. (raised from /usr/local/lib/python3.8/dist-packages/jina/helper.py:785)
DEBUG  upscaler/rep-0@22 <executor.SwinIRUpscaler object at  [06/15/22 23:06:37]
       0x7fc964903130> is successfully loaded!
DEBUG  gateway/rep-0@24 adding connection for deployment     [06/15/22 23:06:37]
       dalle/heads/0 to grpc://0.0.0.0:64434
DEBUG  gateway/rep-0@24 adding connection for deployment
       diffusion/heads/0 to grpc://0.0.0.0:50253
DEBUG  gateway/rep-0@24 adding connection for deployment
       rerank/heads/0 to grpc://0.0.0.0:64683
DEBUG  gateway/rep-0@24 adding connection for deployment
       upscaler/heads/0 to grpc://0.0.0.0:60048
DEBUG  gateway/rep-0@24 adding connection for deployment
       store/heads/0 to grpc://0.0.0.0:55863
DEBUG  gateway/rep-0@24 start server bound to 0.0.0.0:51005
DEBUG  upscaler/rep-0@22 start listening on 0.0.0.0:60048
DEBUG  store/rep-0@23 <executor.MyStore object at            [06/15/22 23:06:37]
       0x7fc964903cd0> is successfully loaded!
DEBUG  store/rep-0@23 start listening on 0.0.0.0:55863
DEBUG  gateway/rep-0@ 1 ready and listening                  [06/15/22 23:06:37]
DEBUG  upscaler/rep-0@ 1 ready and listening                 [06/15/22 23:06:37]
DEBUG  store/rep-0@ 1 ready and listening                    [06/15/22 23:06:37]
DEBUG  rerank/rep-0@21 <executor.ReRank object at            [06/15/22 23:06:37]
       0x7fc9646ca3a0> is successfully loaded!
DEBUG  rerank/rep-0@21 start listening on 0.0.0.0:64683
DEBUG  rerank/rep-0@ 1 ready and listening                   [06/15/22 23:06:37]
UserWarning: It looks like you are trying to import multiple python modules using `py_modules`. When using multiple python files to define an executor, the recommended practice is to structure the files in a python package, and only import the `__init__.py` file of that package. For more details, please check out the cookbook: https://docs.jina.ai/fundamentals/executor/repository-structure/ (raised from /usr/local/lib/python3.8/dist-packages/jina/jaml/helper.py:260)
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses (raised from /usr/local/lib/python3.8/dist-packages/flatbuffers/compat.py:19)
wandb: Appending key for api.wandb.ai to your netrc file: /home/dalle/.netrc
wandb: Tracking run with wandb version 0.12.18
wandb: Run data is saved locally in /dalle/dalle-flow/wandb/run-20220615_230644-os77dzlr
wandb: Run `wandb offline` to turn off syncing.
wandb: Syncing run honest-eon-1
wandb: ⭐️ View project at https://wandb.ai/anony-mouse-316250/uncategorized?apiKey=
wandb: 🚀 View run at https://wandb.ai/anony-mouse-316250/uncategorized/runs/os77dzlr?apiKey=
wandb: WARNING Do NOT share these links with anyone. They can be used to claim your runs.
wandb: Downloading large artifact mega-1-fp16:latest, 4938.53MB. 7 files... Done. 0:0:11.6
WARNI… diffusion/rep-0@ 1 <jina.orchestrate.pods.Pod object  [06/15/22 23:16:37]
       at 0x7fc9675ae970> timeout after waiting for
       600000ms, if your executor takes time to load, you
       may increase --timeout-ready
DEBUG  diffusion/rep-0@ 1 waiting for ready or shutdown
       signal from runtime
DEBUG  diffusion/rep-0@ 1 Runtime was never started. Runtime
       will end gracefully on its own
DEBUG  diffusion/rep-0@ 1 terminated
DEBUG  diffusion/rep-0@ 1 waiting for ready or shutdown
       signal from runtime
DEBUG  diffusion/rep-0@ 1 shutdown is is already set.
       Runtime will end gracefully on its own
DEBUG  diffusion/rep-0@ 1 terminated
DEBUG  diffusion/rep-0@ 1 joining the process
DEBUG  diffusion/rep-0@ 1 successfully joined the process

Any solutions?

Diffusion Momentum

I think the human-in-the-loop part could be much enhanced by adding momentum to the diffusion phase. That way it might be much easier to get significant and meaningful changes in the images.
As pseudocode:

def diffusion(image):
    momentum = 0
    while True:
        diffused_images = diffuse(image.latent_encoding + momentum)
        new_image = user_choice(diffused_images)
        momentum += new_image.latent_encoding - image.latent_encoding
        if stop_diffusion:
            break

Any chance we could get something like that or is it already possible to access the latent encoding so I can implement it myself?

ImportError: cannot import name 'MofNCompleteColumn' from 'rich.progress'

Have this issue after run jina flow

My device is Mac Pro M1

➜  dalle-flow git:(main) jina flow --uses flow.yml
Traceback (most recent call last):
  File "/usr/local/bin/jina", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/jina_cli/__init__.py", line 141, in main
    args = _get_run_args()
  File "/usr/local/lib/python3.9/site-packages/jina_cli/__init__.py", line 8, in _get_run_args
    from jina.helper import get_rich_console
  File "/usr/local/lib/python3.9/site-packages/jina/__init__.py", line 200, in <module>
    from jina.orchestrate.flow.asyncio import AsyncFlow
  File "/usr/local/lib/python3.9/site-packages/jina/orchestrate/flow/asyncio.py", line 2, in <module>
    from jina.orchestrate.flow.base import Flow
  File "/usr/local/lib/python3.9/site-packages/jina/orchestrate/flow/base.py", line 29, in <module>
    from rich.progress import (
ImportError: cannot import name 'MofNCompleteColumn' from 'rich.progress' (/usr/local/lib/python3.9/site-packages/rich/progress.py)

Dalle endpoint

Any chance to get an endpoint for generating images using just dalle and not glid-3? This would be useful for reducing the latency when generating the initial images.

eventloop keeps crashing in the background

Exception in thread Thread-22:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/dist-packages/jina/helper.py", line 1292, in run
self.result = asyncio.run(func(*args, **kwargs))
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "/usr/local/lib/python3.7/dist-packages/jina/clients/mixin.py", line 176, in _get_results
async for resp in c._get_results(*args, **kwargs):
File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 96, in _get_results
logger=self.logger,
File "/usr/local/lib/python3.7/dist-packages/jina/clients/helper.py", line 81, in callback_exec
raise BadServer(response.header)
jina.excepts.BadServer: request_id: "455de4daf4034b088f72b4816848e152"
status {
code: ERROR
description: "BadClient('gRPC error: StatusCode.UNKNOWN Received http2 header with status: 524')"
exception {
name: "BadClient"
args: "gRPC error: StatusCode.UNKNOWN Received http2 header with status: 524"
stacks: "Traceback (most recent call last):\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/jina/clients/base/grpc.py", line 83, in _get_results\n async for resp in stub.Call(\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/grpc/aio/_call.py", line 326, in _fetch_stream_responses\n await self._raise_for_status()\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/grpc/aio/_call.py", line 236, in _raise_for_status\n raise _create_rpc_error(await self.initial_metadata(), await\n"
stacks: "grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:\n\tstatus = StatusCode.UNKNOWN\n\tdetails = "Received http2 header with status: 524"\n\tdebug_error_string = "{"created":"@1657811503.084804400","description":"Error received from peer ipv4:188.114.96.3:2096","file":"src/core/lib/surface/call.cc","file_line":966,"grpc_message":"Received http2 header with status: 524","grpc_status":2}"\n>\n"
stacks: "\nThe above exception was the direct cause of the following exception:\n\n"
stacks: "Traceback (most recent call last):\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/jina/serve/runtimes/worker/init.py", line 165, in process_data\n return await self._data_request_handler.handle(requests=requests)\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/jina/serve/runtimes/request_handlers/data_request_handler.py", line 150, in handle\n return_data = await self._executor.acall(\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/jina/serve/executors/init.py", line 288, in acall\n return await self.acall_endpoint(req_endpoint, **kwargs)\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/jina/serve/executors/init.py", line 309, in acall_endpoint\n return await func(self, **kwargs)\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/jina/serve/executors/decorators.py", line 207, in arg_wrapper\n return await fn(executor_instance, *args, **kwargs)\n"
stacks: " File "/workdir/executor/executor.py", line 69, in diffusion\n await self.run_glid3(d, d.text, skip_rate=skip_rate, num_images=num_images)\n"
stacks: " File "/workdir/executor/executor.py", line 48, in run_glid3\n await do_run(args)\n"
stacks: " File "/workdir/glid-3-xl/dalle_flow_glid3/sample.py", line 118, in do_run\n text_emb_clip_blank = await clip_c.aencode(\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/clip_client/client.py", line 272, in aencode\n async for da in self._async_client.post(\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/jina/clients/mixin.py", line 257, in post\n async for result in c._get_results(\n"
stacks: " File "/usr/local/lib/python3.8/dist-packages/jina/clients/base/grpc.py", line 134, in _get_results\n raise BadClient(msg) from err\n"
stacks: "jina.excepts.BadClient: gRPC error: StatusCode.UNKNOWN Received http2 header with status: 524\n"
executor: "GLID3Diffusion"
}
}
exec_endpoint: "/"


AttributeError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/jina/helper.py in run_async(func, *args, **kwargs)
1306 try:
-> 1307 return thread.result
1308 except AttributeError:

AttributeError: '_RunThread' object has no attribute 'result'

During handling of the above exception, another exception occurred:

BadClient Traceback (most recent call last)
7 frames
in time(self, line, cell, local_ns)

in ()

/usr/local/lib/python3.7/dist-packages/jina/helper.py in run_async(func, *args, **kwargs)
1310
1311 raise BadClient(
-> 1312 'something wrong when running the eventloop, result can not be retrieved'
1313 )
1314 else:

BadClient: something wrong when running the eventloop, result can not be retrieved

i dont know how to fix this

Local Server Error -- "RuntimeFailToStart"

I'm trying to run a local server in an anaconda environment; I've tried rebuilding the environment and even installed all dependencies manually, but I still get the same error. Running Mint/Ubuntu 20.04 with an RTX 3090 (needed to update PyTorch for the 3090, this initially threw and error as well)

The first error in seems to be "can not import module from home/user/ml/dalle/dalle-flow/executors/dalle/dm_helper.py"

DEBUG store/rep-0@17770 ready and listening [05/15/22 14:01:07]
⠙ Waiting dalle diffusion rerank upscaler store gateway ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/6 0:00:00DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses (raised from /home/leary/anaconda3/envs/dalle/lib/python3.8/site-packages/flatbuffers/compat.py:19)
⠹ Waiting dalle diffusion store ━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━ 3/6 0:00:00CRITI… dalle/rep-0@17773 can not load the executor from executors/dalle/config.yml [05/15/22 14:01:07]
⠴ Waiting dalle diffusion ━━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━ 4/6 0:00:00ERROR dalle/rep-0@17773 ImportError('can not import module from [05/15/22 14:01:07]
/home/leary/ml/dalle/dalle-flow/executors/dalle/dm_helper.py') during <class
'jina.serve.runtimes.worker.WorkerRuntime'> initialization
add "--quiet-error" to suppress the exception details

and the second error appears to be " AttributeError: module 'jaxlib.pocketfft' has no attribute 'pocketfft' "

which throws an additional " ImportError: can not import module from
/home/user/ml/dalle/dalle-flow/executors/dalle/dm_helper.py "

OperationalError: database is locked in MyStore executor

I'm getting this error when launching the server both in Docker or natively.

the dalle-flow.db gets created with 777 but then this database is locked error occurs and no tables are ever initialised, the file remains empty.

I made no changes to the executor or the yml file and DocumentArray initialisation seems correct...

from jina import Executor, requests, DocumentArray
from jina.logging.predefined import default_logger


class MyStore(Executor):

    def __init__(self, store_path: str, **kwargs):
        super().__init__(**kwargs)
        self.storage = DocumentArray(storage='sqlite', config={'connection': store_path, 'table_name': f'dallemega'})

Google colab throw out the following issues

when running the client.ipynb in colab, it throws out some errors for the following code:

`%%time

from docarray import Document

da = Document(text=prompt).post(server_url, parameters={'num_images': 8}).matches

da.plot_image_sprites(fig_size=(10,10), show_index=True)`

The error is:
`╭──────────────────────────── Traceback (most recent call last) ────────────────────────────╮
│ /usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py:2882 in run_code │
│ │
│ 2879 │ │ │ try: │
│ 2880 │ │ │ │ self.hooks.pre_run_code_hook() │
│ 2881 │ │ │ │ #rprint('Running code', repr(code_obj)) # dbg │
│ ❱ 2882 │ │ │ │ exec(code_obj, self.user_global_ns, self.user_ns) │
│ 2883 │ │ │ finally: │
│ 2884 │ │ │ │ # Reset our crash handler in place │
│ 2885 │ │ │ │ sys.excepthook = old_excepthook │
│ :1 in │
│ │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py:2117 in │
│ run_cell_magic │
│ │
│ 2114 │ │ │ stack_depth = 2 │
│ 2115 │ │ │ magic_arg_s = self.var_expand(line, stack_depth) │
│ 2116 │ │ │ with self.builtin_trap: │
│ ❱ 2117 │ │ │ │ result = fn(magic_arg_s, cell) │
│ 2118 │ │ │ return result │
│ 2119 │ │
│ 2120 │ def find_line_magic(self, magic_name): │
│ :2 in time │
│ │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/magic.py:188 in │
│ │
│ 185 │ # This is a closure to capture the magic_kind. We could also use a class, │
│ 186 │ # but it's overkill for just that one bit of state. │
│ 187 │ def magic_deco(arg): │
│ ❱ 188 │ │ call = lambda f, *a, **k: f(*a, **k) │
│ 189 │ │ │
│ 190 │ │ if callable(arg): │
│ 191 │ │ │ # "Naked" decorator call (just @foo, no args) │
│ │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/magics/execution.py:1193 in time │
│ │
│ 1190 │ │ │ end = clock2() │
│ 1191 │ │ else: │
│ 1192 │ │ │ st = clock2() │
│ ❱ 1193 │ │ │ exec(code, glob, local_ns) │
│ 1194 │ │ │ end = clock2() │
│ 1195 │ │ │ out = None │
│ 1196 │ │ wall_end = wtime() │
│ :4 in │
│ │
│ /usr/local/lib/python3.7/dist-packages/docarray/document/mixins/sugar.py:92 in post │
│ │
│ 89 │ │ from ... import DocumentArray │
│ 90 │ │ │
│ 91 │ │ _tmp = DocumentArray(self) │
│ ❱ 92 │ │ return _tmp.post(*args, **kwargs)[0] │
│ 93 │
│ │
│ /usr/local/lib/python3.7/dist-packages/docarray/array/mixins/post.py:73 in post │
│ │
│ 70 │ │ elif _scheme in ('grpc', 'http', 'ws', 'websocket'): │
│ 71 │ │ │ from jina import Client │
│ 72 │ │ │ │
│ ❱ 73 │ │ │ if _port: │
│ 74 │ │ │ │ standardized_host += f':{_port}' │
│ 75 │ │ │ │
│ 76 │ │ │ c = Client(host=standardized_host) │
│ │
│ /usr/local/lib/python3.7/dist-packages/jina/init.py:199 in │
│ │
│ 196 │
│ 197 # Client │
│ 198 from jina.clients import Client │
│ ❱ 199 from jina.orchestrate.flow.asyncio import AsyncFlow │
│ 200 │
│ 201 # Flow │
│ 202 from jina.orchestrate.flow.base import Flow │
│ │
│ /usr/local/lib/python3.7/dist-packages/jina/orchestrate/flow/asyncio.py:2 in │
│ │
│ 1 from jina.clients.mixin import AsyncPostMixin │
│ ❱ 2 from jina.orchestrate.flow.base import Flow │
│ 3 │
│ 4 │
│ 5 class AsyncFlow(AsyncPostMixin, Flow): │
│ │
│ /usr/local/lib/python3.7/dist-packages/jina/orchestrate/flow/base.py:65 in │
│ │
│ 62 ) │
│ 63 from jina.jaml import JAMLCompatible │
│ 64 from jina.logging.logger import JinaLogger │
│ ❱ 65 from jina.orchestrate.deployments import Deployment │
│ 66 from jina.orchestrate.flow.builder import _hanging_deployments, allowed_levels │
│ 67 from jina.parsers import ( │
│ 68 │ set_client_cli_parser, │
│ │
│ /usr/local/lib/python3.7/dist-packages/jina/orchestrate/deployments/init.py:17 in │
│ │
│ │
│ 14 from jina.hubble.helper import replace_secret_of_hub_uri │
│ 15 from jina.hubble.hubio import HubIO │
│ 16 from jina.jaml.helper import complete_path │
│ ❱ 17 from jina.orchestrate.pods.container import ContainerPod │
│ 18 from jina.orchestrate.pods.factory import PodFactory │
│ 19 from jina.serve.networking import GrpcConnectionPool, host_is_local, in_docker │
│ 20 │
│ │
│ /usr/local/lib/python3.7/dist-packages/jina/orchestrate/pods/init.py:15 in │
│ │
│ 12 from jina.helper import typename │
│ 13 from jina.jaml import JAML │
│ 14 from jina.logging.logger import JinaLogger │
│ ❱ 15 from jina.orchestrate.pods.helper import ConditionalEvent, _get_event │
│ 16 from jina.serve.runtimes.asyncio import AsyncNewLoopRuntime │
│ 17 │
│ 18 all = ['BasePod', 'Pod'] │
│ │
│ /usr/local/lib/python3.7/dist-packages/jina/orchestrate/pods/helper.py:11 in │
│ │
│ 8 from jina.enums import GatewayProtocolType, PodRoleType │
│ 9 from jina.hubble.helper import is_valid_huburi │
│ 10 from jina.hubble.hubio import HubIO │
│ ❱ 11 from jina.serve.networking import GrpcConnectionPool │
│ 12 from jina.types.request.control import ControlRequest │
│ 13 │
│ 14 if TYPE_CHECKING: │
│ │
│ /usr/local/lib/python3.7/dist-packages/jina/serve/networking.py:17 in │
│ │
│ 14 from jina.enums import PollingType │
│ 15 from jina.importer import ImportExtensions │
│ 16 from jina.logging.logger import JinaLogger │
│ ❱ 17 from jina.proto import jina_pb2, jina_pb2_grpc │
│ 18 from jina.types.request import Request │
│ 19 from jina.types.request.control import ControlRequest │
│ 20 from jina.types.request.data import DataRequest │
│ │
│ /usr/local/lib/python3.7/dist-packages/jina/proto/jina_pb2.py:16 in │
│ │
│ 13 _sym_db = _symbol_database.Default() │
│ 14 │
│ 15 │
│ ❱ 16 import docarray.proto.docarray_pb2 as docarray__pb2 │
│ 17 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 │
│ 18 from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 │
│ 19 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 │
│ │
│ /usr/local/lib/python3.7/dist-packages/docarray/proto/docarray_pb2.py:44 in │
│ │
│ 41 │ has_default_value=False, default_value=b"", │
│ 42 │ message_type=None, enum_type=None, containing_type=None, │
│ 43 │ is_extension=False, extension_scope=None, │
│ ❱ 44 │ serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_c │
│ 45 │ _descriptor.FieldDescriptor( │
│ 46 │ name='shape', full_name='docarray.DenseNdArrayProto.shape', index=1, │
│ 47 │ number=2, type=13, cpp_type=3, label=3, │
│ │
│ /usr/local/lib/python3.7/dist-packages/google/protobuf/descriptor.py:560 in new
│ │
│ 557 │ │ │ │ serialized_options=None, │
│ 558 │ │ │ │ has_default_value=True, containing_oneof=None, json_name=None, │
│ 559 │ │ │ │ file=None, create_key=None): # pylint: disable=redefined-builtin │
│ ❱ 560 │ _message.Message._CheckCalledFromGeneratedFile() │
│ 561 │ if is_extension: │
│ 562 │ │ return _message.default_pool.FindExtensionByName(full_name) │
│ 563 │ else: │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be
regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing
    and will be much slower).

More information:
https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates`

My colab is running Python 3.7.13
What is the JINA version you used before?
Thanks

Error on first step sending prompt to server

Running newest version of notebook in Colab.

Exception in thread Thread-11:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 70, in _get_results
    compression.lower(), grpc.Compression.NoCompression
  File "/usr/local/lib/python3.7/dist-packages/grpc/aio/_call.py", line 326, in _fetch_stream_responses
    await self._raise_for_status()
  File "/usr/local/lib/python3.7/dist-packages/grpc/aio/_call.py", line 237, in _raise_for_status
    self._cython_call.status())
grpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:
	status = StatusCode.UNKNOWN
	details = "Received http2 header with status: 524"
	debug_error_string = "{"created":"@1652450760.048636782","description":"Error received from peer ipv4:104.21.69.21:2087","file":"src/core/lib/surface/call.cc","file_line":952,"grpc_message":"Received http2 header with status: 524","grpc_status":2}"
>

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

Traceback (most recent call last):
  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.7/dist-packages/jina/helper.py", line 1311, in run
    self.result = asyncio.run(func(*args, **kwargs))
  File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/mixin.py", line 152, in _get_results
    async for resp in c._get_results(*args, **kwargs):
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 133, in _get_results
    raise e
  File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 113, in _get_results
    raise BadClient(msg) from err
jina.excepts.BadClient: gRPC error: StatusCode.UNKNOWN Received http2 header with status: 524

╭──────────────────────────── Traceback (most recent call last) ────────────────────────────╮
│ /usr/local/lib/python3.7/dist-packages/jina/helper.py:1326 in run_async                   │
│                                                                                           │
│   1323 │   │   │   thread.start()                                                         │
│   1324 │   │   │   thread.join()                                                          │
│   1325 │   │   │   try:                                                                   │
│ ❱ 1326 │   │   │   │   return thread.result                                               │
│   1327 │   │   │   except AttributeError:                                                 │
│   1328 │   │   │   │   from jina.excepts import BadClient                                 │
│   1329                                                                                    │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: '_RunThread' object has no attribute 'result'

During handling of the above exception, another exception occurred:

╭──────────────────────────── Traceback (most recent call last) ────────────────────────────╮
│ /usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py:2882 in run_code  │
│                                                                                           │
│   2879 │   │   │   try:                                                                   │
│   2880 │   │   │   │   self.hooks.pre_run_code_hook()                                     │
│   2881 │   │   │   │   #rprint('Running code', repr(code_obj)) # dbg                      │
│ ❱ 2882 │   │   │   │   exec(code_obj, self.user_global_ns, self.user_ns)                  │
│   2883 │   │   │   finally:                                                               │
│   2884 │   │   │   │   # Reset our crash handler in place                                 │
│   2885 │   │   │   │   sys.excepthook = old_excepthook                                    │
│ <ipython-input-3-c8bf11265368>:1 in <module>                                              │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py:2117 in           │
│ run_cell_magic                                                                            │
│                                                                                           │
│   2114 │   │   │   stack_depth = 2                                                        │
│   2115 │   │   │   magic_arg_s = self.var_expand(line, stack_depth)                       │
│   2116 │   │   │   with self.builtin_trap:                                                │
│ ❱ 2117 │   │   │   │   result = fn(magic_arg_s, cell)                                     │
│   2118 │   │   │   return result                                                          │
│   2119 │                                                                                  │
│   2120 │   def find_line_magic(self, magic_name):                                         │
│ <decorator-gen-53>:2 in time                                                              │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/magic.py:188 in <lambda>              │
│                                                                                           │
│   185 │   # This is a closure to capture the magic_kind.  We could also use a class,      │
│   186 │   # but it's overkill for just that one bit of state.                             │
│   187 │   def magic_deco(arg):                                                            │
│ ❱ 188 │   │   call = lambda f, *a, **k: f(*a, **k)                                        │
│   189 │   │                                                                               │
│   190 │   │   if callable(arg):                                                           │
│   191 │   │   │   # "Naked" decorator call (just @foo, no args)                           │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/magics/execution.py:1193 in time      │
│                                                                                           │
│   1190 │   │   │   end = clock2()                                                         │
│   1191 │   │   else:                                                                      │
│   1192 │   │   │   st = clock2()                                                          │
│ ❱ 1193 │   │   │   exec(code, glob, local_ns)                                             │
│   1194 │   │   │   end = clock2()                                                         │
│   1195 │   │   │   out = None                                                             │
│   1196 │   │   wall_end = wtime()                                                         │
│ <timed exec>:4 in <module>                                                                │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/docarray/document/mixins/sugar.py:92 in post       │
│                                                                                           │
│   89 │   │   from ... import DocumentArray                                                │
│   90 │   │                                                                                │
│   91 │   │   _tmp = DocumentArray(self)                                                   │
│ ❱ 92 │   │   return _tmp.post(*args, **kwargs)[0]                                         │
│   93                                                                                      │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/docarray/array/mixins/post.py:85 in post           │
│                                                                                           │
│   82 │   │   │   │   show_progress=show_progress,                                         │
│   83 │   │   │   │   request_size=batch_size,                                             │
│   84 │   │   │   │   parameters=parameters,                                               │
│ ❱ 85 │   │   │   │   **kwargs,                                                            │
│   86 │   │   │   )                                                                        │
│   87 │   │   else:                                                                        │
│   88 │   │   │   raise ValueError(f'unsupported scheme: {r.scheme}')                      │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/jina/clients/mixin.py:171 in post                  │
│                                                                                           │
│   168 │   │   │   target_executor=target_executor,                                        │
│   169 │   │   │   parameters=parameters,                                                  │
│   170 │   │   │   request_size=request_size,                                              │
│ ❱ 171 │   │   │   **kwargs,                                                               │
│   172 │   │   )                                                                           │
│   173 │                                                                                   │
│   174 │   # ONLY CRUD, for other request please use `.post`                               │
│                                                                                           │
│ /usr/local/lib/python3.7/dist-packages/jina/helper.py:1331 in run_async                   │
│                                                                                           │
│   1328 │   │   │   │   from jina.excepts import BadClient                                 │
│   1329 │   │   │   │                                                                      │
│   1330 │   │   │   │   raise BadClient(                                                   │
│ ❱ 1331 │   │   │   │   │   'something wrong when running the eventloop, result can not be │
│   1332 │   │   │   │   )                                                                  │
│   1333 │   │   else:                                                                      │
│   1334                                                                                    │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
BadClient: something wrong when running the eventloop, result can not be retrieved

New issue

the colab is not working for me since yesterday

Traceback (most recent call last) ────────────────────────────╮
│ /usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py:2882 in run_code │
│ │
│ 2879 │ │ │ try: │
│ 2880 │ │ │ │ self.hooks.pre_run_code_hook() │
│ 2881 │ │ │ │ #rprint('Running code', repr(code_obj)) # dbg │
│ ❱ 2882 │ │ │ │ exec(code_obj, self.user_global_ns, self.user_ns) │
│ 2883 │ │ │ finally: │
│ 2884 │ │ │ │ # Reset our crash handler in place │
│ 2885 │ │ │ │ sys.excepthook = old_excepthook │
│ :1 in │
│ │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/interactiveshell.py:2117 in │
│ run_cell_magic │
│ │
│ 2114 │ │ │ stack_depth = 2 │
│ 2115 │ │ │ magic_arg_s = self.var_expand(line, stack_depth) │
│ 2116 │ │ │ with self.builtin_trap: │
│ ❱ 2117 │ │ │ │ result = fn(magic_arg_s, cell) │
│ 2118 │ │ │ return result │
│ 2119 │ │
│ 2120 │ def find_line_magic(self, magic_name): │
│ :2 in time │
│ │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/magic.py:188 in │
│ │
│ 185 │ # This is a closure to capture the magic_kind. We could also use a class, │
│ 186 │ # but it's overkill for just that one bit of state. │
│ 187 │ def magic_deco(arg): │
│ ❱ 188 │ │ call = lambda f, *a, **k: f(*a, **k) │
│ 189 │ │ │
│ 190 │ │ if callable(arg): │
│ 191 │ │ │ # "Naked" decorator call (just @foo, no args) │
│ │
│ /usr/local/lib/python3.7/dist-packages/IPython/core/magics/execution.py:1193 in time │
│ │
│ 1190 │ │ │ end = clock2() │
│ 1191 │ │ else: │
│ 1192 │ │ │ st = clock2() │
│ ❱ 1193 │ │ │ exec(code, glob, local_ns) │
│ 1194 │ │ │ end = clock2() │
│ 1195 │ │ │ out = None │
│ 1196 │ │ wall_end = wtime() │
│ :6 in │
│ │
│ /usr/local/lib/python3.7/dist-packages/docarray/array/mixins/plot.py:337 in │
│ plot_image_sprites │
│ │
│ 334 │ │ :param show_progress: show a progresbar. │
│ 335 │ │ """ │
│ 336 │ │ if not self: │
│ ❱ 337 │ │ │ raise ValueError(f'{self!r} is empty') │
│ 338 │ │ │
│ 339 │ │ import matplotlib.pyplot as plt │
│ 340 │
╰───────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: <DocumentArray (length=0) at 140009031661712> is empty

Several errors in Docker

Hello, I'm running into errors when running in Docker.

Right off the bat it throws this error:

`ERROR rerank/rep-0@21 ImportError('can not import module [06/20/22 13:48:52]
from /dalle/dalle-flow/executors/rerank/executor.py')
during <class
'jina.serve.runtimes.worker.WorkerRuntime'>
initialization
add "--quiet-error" to suppress the exception
details
╭──────── Traceback (most recent call last) ────────╮
│ /usr/local/lib/python3.8/dist-packages/jina/impo… │
│ in _path_import │
│ │
│ 124 │ │ spec = importlib.util.spec_from_fil │
│ 125 │ │ module = importlib.util.module_from │
│ 126 │ │ sys.modules[spec_name] = module │
│ ❱ 127 │ │ spec.loader.exec_module(module) │
│ 128 │ except Exception as ex: │
│ 129 │ │ raise ImportError(f'can not import │
│ 130 │
│ :848 in │
│ exec_module │
│ :219 in │
│ _call_with_frames_removed │
│ │
│ /dalle/dalle-flow/executors/rerank/executor.py:1 │
│ in │
│ │
│ ❱ 1 from clip_client import Client │
│ 2 from jina import Executor, requests, Documen │
│ 3 │
│ 4 │
│ │
│ /usr/local/lib/python3.8/dist-packages/clip_clie… │
│ in │
│ │
│ 5 from clip_client.client import Client │
│ 6 │
│ 7 if 'NO_VERSION_CHECK' not in os.environ: │
│ ❱ 8 │ from clip_server.helper import is_latest │
│ 9 │ │
│ 10 │ is_latest_version(github_repo='clip-as-s │
│ 11 │
╰───────────────────────────────────────────────────╯
ModuleNotFoundError: No module named 'clip_server'

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

   ╭──────── Traceback (most recent call last) ────────╮
   │ /usr/local/lib/python3.8/dist-packages/jina/orch… │
   │ in run                                            │
   │                                                   │
   │    71 │                                           │
   │    72 │   try:                                    │
   │    73 │   │   _set_envs()                         │
   │ ❱  74 │   │   runtime = runtime_cls(              │
   │    75 │   │   │   args=args,                      │
   │    76 │   │   )                                   │
   │    77 │   except Exception as ex:                 │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/serv… │
   │ in __init__                                       │
   │                                                   │
   │    28 │   │   :param kwargs: keyword args         │
   │    29 │   │   """                                 │
   │    30 │   │   self._health_servicer = health.Heal │
   │ ❱  31 │   │   super().__init__(args, **kwargs)    │
   │    32 │                                           │
   │    33 │   async def async_setup(self):            │
   │    34 │   │   """                                 │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/serv… │
   │ in __init__                                       │
   │                                                   │
   │    63 │   │   │   )                               │
   │    64 │   │                                       │
   │    65 │   │   self._setup_monitoring()            │
   │ ❱  66 │   │   self._loop.run_until_complete(self. │
   │    67 │                                           │
   │    68 │   def run_forever(self):                  │
   │    69 │   │   """                                 │
   │                                                   │
   │ /usr/lib/python3.8/asyncio/base_events.py:616 in  │
   │ run_until_complete                                │
   │                                                   │
   │    613 │   │   if not future.done():              │
   │    614 │   │   │   raise RuntimeError('Event loop │
   │    615 │   │                                      │
   │ ❱  616 │   │   return future.result()             │
   │    617 │                                          │
   │    618 │   def stop(self):                        │
   │    619 │   │   """Stop running the event loop.    │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/serv… │
   │ in async_setup                                    │
   │                                                   │
   │    55 │   │   else:                               │
   │    56 │   │   │   self._summary_time = contextlib │
   │    57 │   │                                       │
   │ ❱  58 │   │   await self._async_setup_grpc_server │
   │    59 │                                           │
   │    60 │   async def _async_setup_grpc_server(self │
   │    61 │   │   """                                 │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/serv… │
   │ in _async_setup_grpc_server                       │
   │                                                   │
   │    65 │   │   # Keep this initialization order    │
   │    66 │   │   # otherwise readiness check is not  │
   │    67 │   │   # The DataRequestHandler needs to b │
   │ ❱  68 │   │   self._data_request_handler = DataRe │
   │    69 │   │   │   self.args, self.logger, self.me │
   │    70 │   │   )                                   │
   │    71                                             │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/serv… │
   │ in __init__                                       │
   │                                                   │
   │    38 │   │   self.args.parallel = self.args.shar │
   │    39 │   │   self.logger = logger                │
   │    40 │   │   self._is_closed = False             │
   │ ❱  41 │   │   self._load_executor(metrics_registr │
   │    42 │   │   self._init_monitoring(metrics_regis │
   │    43 │                                           │
   │    44 │   def _init_monitoring(self, metrics_regi │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/serv… │
   │ in _load_executor                                 │
   │                                                   │
   │    76 │   │   :param metrics_registry: Optional p │
   │       passed to the executor so that it can expos │
   │    77 │   │   """                                 │
   │    78 │   │   try:                                │
   │ ❱  79 │   │   │   self._executor: BaseExecutor =  │
   │    80 │   │   │   │   self.args.uses,             │
   │    81 │   │   │   │   uses_with=self.args.uses_wi │
   │    82 │   │   │   │   uses_metas=self.args.uses_m │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/jaml… │
   │ in load_config                                    │
   │                                                   │
   │   727 │   │   │                                   │
   │   728 │   │   │   if allow_py_modules:            │
   │   729 │   │   │   │   _extra_search_paths = extra │
   │ ❱ 730 │   │   │   │   load_py_modules(            │
   │   731 │   │   │   │   │   no_tag_yml,             │
   │   732 │   │   │   │   │   extra_search_paths=(_ex │
   │   733 │   │   │   │   │   if s_path               │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/jaml… │
   │ in load_py_modules                                │
   │                                                   │
   │   267 │   │   │   )                               │
   │   268 │   │                                       │
   │   269 │   │   mod = [complete_path(m, extra_searc │
   │ ❱ 270 │   │   PathImporter.add_modules(*mod)      │
   │   271                                             │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/impo… │
   │ in add_modules                                    │
   │                                                   │
   │   149 │   │   │   │   │   f'cannot import module  │
   │   150 │   │   │   │   )                           │
   │   151 │   │   │                                   │
   │ ❱ 152 │   │   │   _path_import(p)                 │
   │   153                                             │
   │                                                   │
   │ /usr/local/lib/python3.8/dist-packages/jina/impo… │
   │ in _path_import                                   │
   │                                                   │
   │   126 │   │   sys.modules[spec_name] = module     │
   │   127 │   │   spec.loader.exec_module(module)     │
   │   128 │   except Exception as ex:                 │
   │ ❱ 129 │   │   raise ImportError(f'can not import  │
   │   130                                             │
   │   131                                             │
   │   132 class PathImporter:                         │
   ╰───────────────────────────────────────────────────╯
   ImportError: can not import module from
   /dalle/dalle-flow/executors/rerank/executor.py`

then after downloading the mega model from wandb:

ModuleNotFoundError: No module named 'clip_server'

then gives me a CUDA out of memory ( I have an 24GB 3090 RTX, shouldn't be a problem right?) and then gets stuck in:

wandb: Downloading large artifact mega-1-fp16:latest, 4938.53MB. 7 files... Done. 0:0:7.3 device count: 1 DEBUG dalle/rep-0@19 <executor.DalleGenerator object at [06/20/22 13:51:01] 0x7f571825dc40> is successfully loaded! DEBUG dalle/rep-0@19 start listening on 0.0.0.0:59167 DEBUG dalle/rep-0@ 1 ready and listening [06/20/22 13:51:01] ERROR Flow@ 1 Flow is aborted due to ['diffusion', [06/20/22 13:51:01] 'rerank'] can not be started. DEBUG gateway/rep-0@ 1 waiting for ready or shutdown signal [06/20/22 13:51:01] from runtime DEBUG gateway/rep-0@ 1 terminate DEBUG gateway/rep-0@ 1 terminating the runtime process DEBUG gateway/rep-0@ 1 runtime process properly terminated DEBUG gateway/rep-0@ 1 terminated [06/20/22 13:51:02] DEBUG gateway/rep-0@ 1 joining the process DEBUG gateway/rep-0@35 process terminated [06/20/22 13:51:02] DEBUG gateway/rep-0@ 1 successfully joined the process DEBUG store/rep-0@ 1 waiting for ready or shutdown signal [06/20/22 13:51:02] from runtime DEBUG store/rep-0@ 1 terminate DEBUG store/rep-0@ 1 terminating the runtime process DEBUG store/rep-0@ 1 runtime process properly terminated DEBUG store/rep-0@23 cancel WorkerRuntime [06/20/22 13:51:02] DEBUG store/rep-0@23 stopped GRPC Server DEBUG store/rep-0@23 cancel WorkerRuntime DEBUG store/rep-0@23 stopped GRPC Server DEBUG store/rep-0@ 1 terminated DEBUG store/rep-0@ 1 joining the process DEBUG store/rep-0@23 process terminated [06/20/22 13:51:02] DEBUG store/rep-0@ 1 successfully joined the process DEBUG upscaler/rep-0@ 1 waiting for ready or shutdown [06/20/22 13:51:02] signal from runtime DEBUG upscaler/rep-0@ 1 terminate DEBUG upscaler/rep-0@ 1 terminating the runtime process DEBUG upscaler/rep-0@ 1 runtime process properly terminated DEBUG upscaler/rep-0@22 cancel WorkerRuntime [06/20/22 13:51:02] DEBUG upscaler/rep-0@22 stopped GRPC Server DEBUG upscaler/rep-0@22 cancel WorkerRuntime DEBUG upscaler/rep-0@22 stopped GRPC Server DEBUG upscaler/rep-0@ 1 terminated DEBUG upscaler/rep-0@ 1 joining the process DEBUG upscaler/rep-0@22 process terminated [06/20/22 13:51:02] DEBUG upscaler/rep-0@ 1 successfully joined the process DEBUG dalle/rep-0@ 1 waiting for ready or shutdown signal [06/20/22 13:51:02] from runtime DEBUG dalle/rep-0@ 1 terminate DEBUG dalle/rep-0@ 1 terminating the runtime process DEBUG dalle/rep-0@ 1 runtime process properly terminated DEBUG dalle/rep-0@19 cancel WorkerRuntime [06/20/22 13:51:02] DEBUG dalle/rep-0@19 stopped GRPC Server DEBUG dalle/rep-0@19 cancel WorkerRuntime DEBUG dalle/rep-0@19 stopped GRPC Server DEBUG dalle/rep-0@ 1 terminated DEBUG dalle/rep-0@19 process terminated [06/20/22 13:51:02] DEBUG dalle/rep-0@ 1 joining the process

Any ideas on what the problem is?
Running on Ubuntu WSL2 in Windows 10

Using Device CPU issue

Hi,

I am trying the deploy Dalle-Flow server on my M1Pro chip MacbookPro. The machine has GPU, but Dalle-Flow doesn't use it! In the Dalle-diffusion summary phase, it said "Using device: cpu" How can I change this?

This can be a newbie question, because I am a newbie. Any help is much appreciated.

Do I just use a console window (command prompt) to enter this?

I see your instructions has things like: (I don't have Jina installed either for the same reason).

docker pull jinaai/dalle-flow:latest

I have never created a Docker container. Do I use Powershell, or just a command prompt, or what should I be entering these commands into?

I am a C# developer, and I know Python, but I don't have a clue from your instructions what to do.
Is there a YouTube video of how to setup the docker image for Dalle-Flow? I have the GPU for this, so I am anxious to try.

Thank you

Failed to run my own server

Hi, i'm trying to run my own server following the steps in the repo but I've the following error:

jinaerror

I'm on AWS Sagemaker console.. I tried with a ml.g4dn.16xlarge to avoid having resource issues as I thought it was related to that.

Can you help me to solve this issue?

How to Save Images from Python

Dalle-Flow seems to output images as DocArray data type "Document."

How does one use Python to save a DocArray "Document" to an image file on disk?

the iPython Display() functions seems to understand "Document" type, but PIL seems unable to write the data shown by Display() either through save or frombytes.

Using open/write with "wb" produces the error TypeError: a bytes-like object is required, not 'Document'

I have also looked through the DocArray documentation, but only found save_image_tensor_to_file which returns an error "AttributeError: 'NoneType' object has no attribute 'astype'"

Am I missing something obvious?

i think the server's down again-error below

ERROR GRPCClient@192 gRPC error: StatusCode.UNAVAILABLE failed to [06/26/22 11:05:43]
connect to all addresses
The ongoing request is terminated as the server is not available
or closed already.
Exception in thread Thread-21:
Traceback (most recent call last):
File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/dist-packages/jina/helper.py", line 1292, in run
self.result = asyncio.run(func(*args, **kwargs))
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "/usr/local/lib/python3.7/dist-packages/jina/clients/mixin.py", line 163, in _get_results
async for resp in c._get_results(*args, **kwargs):
File "/usr/local/lib/python3.7/dist-packages/jina/clients/base/grpc.py", line 115, in _get_results
raise ConnectionError(my_details) from None
ConnectionError: failed to connect to all addresses


AttributeError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/jina/helper.py in run_async(func, *args, **kwargs)
1306 try:
-> 1307 return thread.result
1308 except AttributeError:

AttributeError: '_RunThread' object has no attribute 'result'

During handling of the above exception, another exception occurred:

BadClient Traceback (most recent call last)
7 frames
in time(self, line, cell, local_ns)

in ()

/usr/local/lib/python3.7/dist-packages/jina/helper.py in run_async(func, *args, **kwargs)
1310
1311 raise BadClient(
-> 1312 'something wrong when running the eventloop, result can not be retrieved'
1313 )
1314 else:

BadClient: something wrong when running the eventloop, result can not be retrieved

Add documentation to run on M1 chip

When running jina flow locally with an M1 chip, I noticed you needed to use a different version of jax to run it.
See here.

Having jax == 0.2.10 does the trick.

It would be good to add it to the documentation.

Can't pull the docker pull jinaai/dalle-flow:latest

The download starting after the command docker pull jinaai/dalle-flow:latest gets interrupted and it shows the error ERROR: unexpected EOF, I've tried downloading multiple times but it didn't work, any suggestion?

FileNotFoundError:

diffusion/rep-0@36167 fail to load file dependency [07/05/22 03:44:38] ⠙ Waiting dalle diffusion summary... ━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━ 4/7 0:00:00ERROR diffusion/rep-0@36167 FileNotFoundError(2, 'No such file or directory') [07/05/22 03:44:38] during <class 'jina.serve.runtimes.worker.WorkerRuntime'> initialization add "--quiet-error" to suppress the exception details

FileNotFoundError: [Errno 2] No such file or directory:
'../glid-3-xl/finetune.pt' `

   bert.pt
   finetune.pt
   kl-f8.pt

are located in /dalle-flow/glid-3-xl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.