本文整理匯總了Python中caffe2.python.dyndep.InitOpsLibrary方法的典型用法代碼示例。如果您正苦於以下問題:Python dyndep.InitOpsLibrary方法的具體用法?Python dyndep.InitOpsLibrary怎麽用?Python dyndep.InitOpsLibrary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類caffe2.python.dyndep
的用法示例。
在下文中一共展示了dyndep.InitOpsLibrary方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: import_detectron_ops
# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def import_detectron_ops():
"""Import Detectron ops."""
detectron_ops_lib = envu.get_detectron_ops_lib()
dyndep.InitOpsLibrary(detectron_ops_lib)
示例2: import_custom_ops
# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def import_custom_ops():
"""Import custom ops."""
custom_ops_lib = envu.get_custom_ops_lib()
dyndep.InitOpsLibrary(custom_ops_lib)
示例3: import_detectron_ops
# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def import_detectron_ops():
"""Import Detectron ops."""
detectron_ops_lib = get_detectron_ops_lib()
dyndep.InitOpsLibrary(detectron_ops_lib)
示例4: _load_custom_dll
# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def _load_custom_dll():
global custom_ops_loaded
if not custom_ops_loaded:
import os
lib_name = 'libcaffe2_mpi_operations.so'
CUSTOM_OPERATIONS = 'CUSTOM_OPERATIONS'
if CUSTOM_OPERATIONS not in os.environ:
raise Exception('Set the custom operator '
'directory via the environment variable: {}'
.format(lib_name, CUSTOM_OPERATIONS))
path = os.environ[CUSTOM_OPERATIONS] + "/" + lib_name
if not os.path.isfile(path):
raise FileNotFoundError('File not found in path: {}'.format(path))
dyndep.InitOpsLibrary(path)
custom_ops_loaded = True
示例5: import_custom_ops
# 需要導入模塊: from caffe2.python import dyndep [as 別名]
# 或者: from caffe2.python.dyndep import InitOpsLibrary [as 別名]
def import_custom_ops():
"""Import custom and contrib ops needed by this software."""
# TODO(rbg): Consider moving into either model_builder or
# DetectionModelHelper
dyndep.InitOpsLibrary('@/caffe2/caffe2/contrib/nccl:nccl_ops')
ops_path = '@/experimental/deeplearning/rgirdhar/VideoPose/lib/ops'
ops_to_import = [
'roi_pool_f_op',
'ps_roi_pool_op',
'l1_loss_op',
'smooth_l1_loss_op',
'affine_channel_op',
'sigmoid_cross_entropy_loss_op',
'upsample_nearest_op',
'integral_image_op',
'roi_pool_late_quantization_op',
'roi_warp_op',
'roi_warp_max_op',
'spatial_narrow_as_op',
'sample_as_op',
'roi_align_op',
'batch_permutation_op',
'affine_channel_nd_op',
# Doesn't work yet.. the CUDA version is not available and will not compile
# 'conv_transpose_3d_op',
]
for op in ops_to_import:
dyndep.InitOpsLibrary(ops_path + ':' + op)