-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add PyTorch 1.11.0 in GH Actions (#359)
* Add PyTorch 1.11.0 in GH Actions * Add check_version from yolov5 * Compatibility updates * GeneratorExp aren't supported in TorchScript * Apply pre-commit * Minor updates * Upgrade PyTorch minimal version to 1.8.0, add Python 3.10 and remove Python 3.6 * Fix pre-commit
- Loading branch information
Showing
6 changed files
with
49 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import logging | ||
|
||
import pkg_resources as pkg | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def check_version( | ||
current: str = "0.0.0", | ||
minimum: str = "0.0.0", | ||
name: str = "version ", | ||
pinned: bool = False, | ||
hard: bool = False, | ||
verbose: bool = False, | ||
): | ||
""" | ||
Check version vs. required version. | ||
Adapted from https://github.com/ultralytics/yolov5/blob/c6b4f84/utils/general.py#L293 | ||
""" | ||
|
||
current, minimum = (pkg.parse_version(x) for x in (current, minimum)) | ||
result = (current == minimum) if pinned else (current >= minimum) # bool | ||
verbose_info = f"{name}{minimum} required by yolort, but {name}{current} is currently installed" | ||
if hard: | ||
assert result, verbose_info # assert min requirements met | ||
if verbose and not result: | ||
logger.warning(verbose_info) | ||
return result |
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