rom1504 / clip-retrieval

Easily compute clip embeddings and build a clip retrieval system with them
https://rom1504.github.io/clip-retrieval/
MIT License
2.42k stars 213 forks source link

KeyError: 'clip_retrieval/../front/build' #177

Closed ChristiaensBert closed 2 years ago

ChristiaensBert commented 2 years ago

I am having an issue when running the clip-retrieval back from CLI. On line 991 of clip_back.py, the method add_static_endpoints(app, default_backend, None, url_column) (imported from clip_front.py) gets called and gives the following error:

Traceback (most recent call last): File "/opt/conda/bin/clip-retrieval-back", line 33, in sys.exit(load_entry_point('clip-retrieval==2.34.2', 'console_scripts', 'clip-retrieval-back')()) File "/opt/conda/lib/python3.7/site-packages/clip_retrieval-2.34.2-py3.7.egg/clip_retrieval/cli_backend.py", line 25, in main File "/opt/conda/lib/python3.7/site-packages/fire/core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/opt/conda/lib/python3.7/site-packages/fire/core.py", line 471, in _Fire target=component.name) File "/opt/conda/lib/python3.7/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/opt/conda/lib/python3.7/site-packages/clip_retrieval-2.34.2-py3.7.egg/clip_retrieval/clip_back.py", line 991, in clip_back File "/opt/conda/lib/python3.7/site-packages/clip_retrieval-2.34.2-py3.7.egg/clip_retrieval/clip_front.py", line 12, in add_static_endpoints File "/opt/conda/lib/python3.7/site-packages/pkg_resources/init.py", line 1136, in resource_filename self, resource_name File "/opt/conda/lib/python3.7/site-packages/pkg_resources/init.py", line 1744, in get_resource_filename return self._extract_resource(manager, zip_path) File "/opt/conda/lib/python3.7/site-packages/pkg_resources/init.py", line 1766, in _extract_resource timestamp, size = self._get_date_and_size(self.zipinfo[zip_path]) KeyError: 'clip_retrieval/../front/build'

Which originates from the front_path = pkg_resources.resource_filename("clip_retrieval", "../front/build") call in add_static_endpoints.

This path is hardcoded, however I don't find a build subfolder in the front folder. Also, I find it a bit weird that there is a .. in the file path, but I'm not sure if this is the cause of the error.

rom1504 commented 2 years ago

Hi, you can follow these instructions https://github.com/rom1504/clip-retrieval#for-development

in particular the npm run build part