NVIDIA-AI-IOT / clip-distillation

Zero-label image classification via OpenCLIP knowledge distillation
Other
112 stars 15 forks source link

Unable to run search_clip_images.py #4

Open arielsolomon opened 9 months ago

arielsolomon commented 9 months ago

Hi, I attempt to run search_clip_images.py either in your docker container or out and I get the same error like nothing is going into image_url.txt file: python3 search_clip_images.py \ "data/text_prompts.txt" \ "data/image_urls.txt" \ -n 5000 \ -m 10000 \ --max_workers 2 \ --append Found the following 2 text prompts in data/text_prompts.txt ['Drone', 'Helicopter'] Querying images with the following prompts... Drone Helicopter Traceback (most recent call last): File "/home/user1/ariel/fed_learn/clip-distillation/search_clip_images.py", line 256, in urls = asyncio.run( File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/home/user1/ariel/fed_learn/clip-distillation/search_clip_images.py", line 118, in clip_search_images_by_multi_text results = await asyncio.gather(*coros) File "/home/user1/ariel/fed_learn/clip-distillation/search_clip_images.py", line 96, in safe_coro return await coro File "/home/user1/ariel/fed_learn/clip-distillation/search_clip_images.py", line 71, in clip_search_images_by_text item['url'] for item in response.json() if 'url' in item File "/usr/lib/python3/dist-packages/requests/models.py", line 900, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.10/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/lib/python3.10/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

FYI, debug raised the following:

The "502 Bad Gateway" error indicates a communication issue between two servers acting as gateways or proxies to fulfill a request. It doesn't specify a problem with your device or internet connection, but rather a fault within the servers involved.

Here's a breakdown of the key points:

Your request reached the first server (nginx) successfully.
Nginx forwarded the request to another upstream server to complete it.
The upstream server failed to respond correctly, causing nginx to return the 502 error.

Possible causes for this error:

Upstream Server Down: The upstream server might be unavailable or experiencing issues.
Overloaded Upstream Server: The upstream server might be overloaded with requests and unable to handle more.
Network Problems: There might be network connectivity issues between nginx and the upstream server.
Misconfiguration: Nginx or the upstream server might be misconfigured.
FudaMingdaXsc commented 6 months ago

I encountered the same problem, did you solve this problem?

burningion commented 6 months ago

Looks like the web server hosting the service: https://knn.laion.ai/knn-service is down. I get a 500 error for that url, but also for https://knn.laion.ai/.

Don't know if NVIDIA has an internally hosted alternative? Seems the team from LAION doesn't think the server will be back up anytime soon: https://github.com/rom1504/clip-retrieval/issues/324