Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Status: 400 after using add_documents() to add the images from docker to index #768

Open
sonamgupta1105 opened this issue Feb 20, 2024 · 0 comments

Comments

@sonamgupta1105
Copy link

Here is the code I am using to build a multilingual image search:

`index_name = "image_search_multi"

settings = {
"model": "multilingual-clip/LABSE-Vit-L-14",
"treatUrlsAndPointersAsImages": True
}

response = mq.create_index(index_name, settings_dict = settings)
import subprocess
local_dir = "/images"
pid = subprocess.Popen(["python3", "-m", "http.server", "8222", "— directory", local_dir], stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
import glob
import os

Find all the local images

locators = glob.glob(local_dir + "*.jpg")

Generate docker path for local images

docker_path = "http://host.docker.internal:8222/"
image_docker = [docker_path + os.path.basename(f) for f in locators]
documents = [
{"image_docker" : image, "_id" : str(idx)} for idx, image in enumerate(image_docker)
]
mq.index(index_name).add_documents(documents,client_batch_size=1, tensor_fields=["image_docker"])`

I get the following error for all the 21 images I uploaded to docker from local machine:
'errors': True,
'processingTimeMs': 42.52098000006299,
'index_name': 'image_search_multi',
'items': {'_id': '0',
'error': 'Could not find image found at [http://host.docker.internal:8222/image0.jpg
. \nReason: image url [http://host.docker.internal:8222/image0.jpg](http://host.docker.internal:8222/image0.jpg%60) is unreachable, perhaps due to timeout. Timeout threshold is set to 3 seconds.\nConnection error type: ConnectionError',
'status': 400,
'code': 'invalid_argument'}

I use Windows 11, conda environment and of course updated docker desktop version. Using the latest marqo release.

Any suggestions on how to fix this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant