openai / CLIP

CLIP (Contrastive Language-Image Pretraining), Predict the most relevant text snippet given an image
MIT License
24.55k stars 3.2k forks source link

`from pkg_resources import packaging` seems not work with `setuptools>=70.0.0` #446

Open PawelPeczek-Roboflow opened 3 months ago

PawelPeczek-Roboflow commented 3 months ago

There was a release of setuptools 70.0.0 (https://pypi.org/project/setuptools/#history) which mentions changes in pkg_resources: https://setuptools.pypa.io/en/stable/history.html#v70-0-0, that gets deprecated: https://setuptools.pypa.io/en/stable/pkg_resources.html.

That implies need for change of entries like that in clip.py module

if packaging.version.parse(torch.__version__) < packaging.version.parse("1.7.1"):
    warnings.warn("PyTorch version 1.7.1 or higher is recommended")

into something supported.

JamieMartin commented 3 months ago

I've opened a PR to fix this. Now works on my end.

449

OR

450

Depending on whether backward compatibility is desired. Feel free to merge this if you need to get it working in the meantime.