forked from facebookresearch/detectron2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add pre-built packages with combination of (cuda, torch) versions
Summary: Pull Request resolved: fairinternal/detectron2#410 Test Plan: github {F238145512} readthedocs: {F238145513} Reviewed By: rbgirshick Differential Revision: D21710420 Pulled By: ppwwyyxx fbshipit-source-id: da055598e77d1ec095c685666c6a02f73f0fe403
- Loading branch information
1 parent
426d239
commit 586e014
Showing
11 changed files
with
189 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
template = """<details><summary> install </summary><pre><code>python -m pip install detectron2 -f \\ | ||
https://dl.fbaipublicfiles.com/detectron2/wheels/{cuda}/torch{torch}/index.html | ||
</code></pre> </details>""" | ||
CUDA_SUFFIX = {"10.2": "cu102", "10.1": "cu101", "10.0": "cu100", "9.2": "cu92", "cpu": "cpu"} | ||
|
||
|
||
def gen_header(torch_versions): | ||
return '<table class="docutils"><tbody><th width="80"> CUDA </th>' + "".join( | ||
[ | ||
'<th valign="bottom" align="left" width="100">torch {}</th>'.format(t) | ||
for t in torch_versions | ||
] | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
all_versions = [("1.4", k) for k in ["10.1", "10.0", "9.2", "cpu"]] + [ | ||
("1.5", k) for k in ["10.2", "10.1", "9.2", "cpu"] | ||
] | ||
|
||
torch_versions = sorted({k[0] for k in all_versions}, key=float, reverse=True) | ||
cuda_versions = sorted( | ||
{k[1] for k in all_versions}, key=lambda x: float(x) if x != "cpu" else 0, reverse=True | ||
) | ||
|
||
table = gen_header(torch_versions) | ||
for cu in cuda_versions: | ||
table += f""" <tr><td align="left">{cu}</td>""" | ||
cu_suffix = CUDA_SUFFIX[cu] | ||
for torch in torch_versions: | ||
if (torch, cu) in all_versions: | ||
cell = template.format(cuda=cu_suffix, torch=torch) | ||
else: | ||
cell = "" | ||
table += f"""<td align="left">{cell} </td> """ | ||
table += "</tr>" | ||
table += "</tbody></table>" | ||
print(table) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.