-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a hook for torchvision.ops (#80)
* tests: add a test for torchvision.ops.nms Reproduces the error from pyinstaller/pyinstaller#5386. * Add a hook for torchvision.ops Add a hidden import of torchvision._C extension module that we fail to pick up automatically. This extension module is required in functions from torchvision.ops.* modules, where its absence causes the _assert_has_ops() call to fail. Fixes the failing test_torchvision_nms. Fixes pyinstaller/pyinstaller#5386.
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add hook for ``torchvision.ops`` to ensure that the required extension module (``torchvision._C``) is collected. |
15 changes: 15 additions & 0 deletions
15
src/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-torchvision.ops.py
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,15 @@ | ||
# ------------------------------------------------------------------ | ||
# Copyright (c) 2020 PyInstaller Development Team. | ||
# | ||
# This file is distributed under the terms of the GNU General Public | ||
# License (version 2.0 or later). | ||
# | ||
# The full license is available in LICENSE.GPL.txt, distributed with | ||
# this software. | ||
# | ||
# SPDX-License-Identifier: GPL-2.0-or-later | ||
# ------------------------------------------------------------------ | ||
|
||
# Functions from torchvision.ops.* modules require torchvision._C | ||
# extension module, which PyInstaller fails to pick up automatically... | ||
hiddenimports = ['torchvision._C'] |
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