mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #169] pytorch version comparison code fails for pytorch 1.10 #148
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#148
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @matthewfranglen on GitHub (Nov 1, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/169
A warning is produced when running clip using pytorch version 1.10 or greater.
The version check code performs a comparison using strings. This fails for version 1.10 because string comparison is left to right and 1 is less than 7.
There is the TorchVersion class that would make this comparison easier to perform however that does not exist in pytorch 1.7. I suggest converting the strings into integers before performing the comparison.
@jongwook commented on GitHub (Nov 1, 2021):
This was suggested in #160 but using
TorchVersiondoes look cleaner. I'll look into fixing this@matthewfranglen commented on GitHub (Nov 1, 2021):
Ah dammit I've just written an identical comparison. Looking at the 1.7 branch of torch I do not see TorchVersion as the torch_version.py file is missing. If you were able to import it to use it then the comparison would pass.
@alex8937 commented on GitHub (Nov 9, 2021):
Got a problem when torch version is
1.9.0a0+2ecb2c7@vinhkhuc commented on GitHub (Nov 10, 2021):
Did anyone try
packaging.versionfromsetuptools? It seems to work well for the following test cases:@jiahuei commented on GitHub (Nov 10, 2021):
This can be closed now since
573315esolves the issue.