jina-ai / jina

☁️ Build multimodal AI applications with cloud-native stack
https://docs.jina.ai
Apache License 2.0
20.64k stars 2.21k forks source link

problems in "Search Similar Images" doc #4277

Closed mgogoulos closed 2 years ago

mgogoulos commented 2 years ago

Hi, having installed jina through pip (v 2.6.4), I tried to follow https://docs.jina.ai/datatype/image/image2image/ but it fails

I guess this is deprecated?

from jina.types.document.generators import from_files
...
ModuleNotFoundError: No module named 'jina.types.document'

Nex, FlashImageEmbedder is not defined/imported before

.add(uses=FlashImageEmbedder, name="Encoder")
...
NameError: name 'FlashImageEmbedder' is not defined

Thanks

JoanFM commented 2 years ago

Hello @mgogoulos ,

Sorry for the inconvenience.

For the first problem:

For the second problem:

Sorry for the inconvenience

mgogoulos commented 2 years ago

Hi, kudos for the lightning-fast reply!

I now install all dependencies for this doc using

pip install jina==2.5 ipython vissl fairscale lightning-flash[image]

perform the small change (FlashImageEmbedder to FlashImageEncoder)

but now end up on a dependency chaos

        Encoder@69249[C]:can not load the executor from FlashImageEncoder
        Encoder@69249[E]:ExecutorFailToLoad() during <class 'jina.peapods.runtimes.zmq.zed.ZEDRuntime'> initialization
    self._embedder = ImageEmbedder(embedding_dim=1024)
TypeError: __init__() got an unexpected keyword argument 'embedding_dim'

The pip install command brought me

lightning-flash             0.6.0
pytorch-lightning           1.5.10

which is clearly not what it needs.

Suggestions on what versions of flash to install? Even better would be to get the exact environment this needs to work!

Thanks

JoanFM commented 2 years ago

Hey @mgogoulos

Sorry for the late reply, we have been working on releaing 3.0 and putting all these tutorials into the Learning Portal and should be soon available.

@alexcg1 @CatStark can you please point to the proper section?

alexcg1 commented 2 years ago

@Shubhamsaboo is leading these efforts. He can answer better than me

Shubhamsaboo commented 2 years ago

Hey, @mgogoulos!

Sorry for the trouble with the tutorial, we were in the process of migrating them from Jina 2 to Jina 3!

You can find the working colab notebook for the same tutorial -> https://colab.research.google.com/github/jina-ai/tutorial-notebooks/blob/main/image2image.ipynb

Soon these changes with all other tutorials will be reflected on our Learning Bootcamp.

Hope this helps and thanks for being patient!

mgogoulos commented 2 years ago

I will give it a try, thanks a lot for replying here

CatStark commented 2 years ago

Hi @mgogoulos ,

No problem. I'll close the issue now but feel free to open a new one if we can help with anything else :)