Skip to content
This repository was archived by the owner on Nov 21, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion detectron/utils/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import os
import sys
import torch

# Default value of the CMake install prefix
_CMAKE_INSTALL_PREFIX = '/usr/local'
Expand Down Expand Up @@ -61,7 +62,7 @@ def import_nccl_ops():
def get_detectron_ops_lib():
"""Retrieve Detectron ops library."""
# Candidate prefixes for detectron ops lib path
prefixes = [_CMAKE_INSTALL_PREFIX, sys.prefix, sys.exec_prefix] + sys.path
prefixes = [_CMAKE_INSTALL_PREFIX, sys.prefix, sys.exec_prefix, os.path.dirname(torch.__file__)] + sys.path
# Candidate subdirs for detectron ops lib
subdirs = ['lib', 'torch/lib']
# Try to find detectron ops lib
Expand Down