本文整理汇总了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)