CogDLRuntime OptimizeTensorRT Method Cognex VisionPro 9.25 SR1
For the specified tool, perform TensorRT optimization using the specified GPU. Width and height set to zero means use training image size.

Namespace: Cognex.VisionPro.DLRuntime
Assembly: Cognex.VisionPro.DLRuntime (in Cognex.VisionPro.DLRuntime.dll) Version: 93.1.0.0 (93.1.0.0)
Syntax

public void OptimizeTensorRT(
	string streamName,
	string toolName,
	int gpuIndex,
	CogDLRuntimeTensorRTModeConstants mode,
	int width = 0,
	int height = 0,
	int batch = 1
)

Parameters

streamName
Type: System String
The name of the stream containing the ViDi tool to be optimized.
toolName
Type: System String
The name of the ViDi tool to be optimized.
gpuIndex
Type: System Int32
The index of the GPU for which this tool will be optimized.
mode
Type: Cognex.VisionPro.DLRuntime CogDLRuntimeTensorRTModeConstants
The desired style of TensorRT optimization. May not be CogDLRuntimeTensorRTModeConstants.None.
width (Optional)
Type: System Int32
The image width, in pixels, for which this ViDi tool should be optimized. A value of zero means use the training image size.
height (Optional)
Type: System Int32
The image height, in pixels, for which this ViDi tool should be optimized. A value of zero means use the training image size.
batch (Optional)
Type: System Int32
The batch size for which this ViDi tool should be optimized. Default is a batch size of 1.
Events

Event TypeReason
ICogChangedEvent Changed Fires when a ViDi tool may have been optimized. The following state flags may be affected:
  • SfGetTensorRTInfo
Exceptions

ExceptionCondition
ArgumentException If the specified tool cannot be accessed.
ArgumentException If the specified tool does not support TensorRT optimization.
ArgumentOutOfRangeException If the specified GPU index is not valid.
ArgumentException If the specified mode is CogDLRuntimeTensorRTModeConstants.None.
CogInternalErrorException If the underlying ViDi tool could not be optimized for any other reason.
See Also