MyCaffe
1.12.2.41
Deep learning software for Windows C# programmers.
|
The MyCaffeConversionControl handles converting between MyCaffe and ONNX formats. The OnnxControl is used to read and write ONNX files. More...
Public Member Functions | |
MyCaffeConversionControl () | |
The constructor. More... | |
MyCaffeConversionControl (IContainer container) | |
The constructor. More... | |
void | SetWeightScaling (double dfMin, double dfMax) |
Set the scaling factors applied to the weights. More... | |
void | ConvertMyCaffeToOnnxFile (CudaDnn< T > cuda, Log log, MyCaffeModelData data, string strOutputFile, int nOpSetVersion=9, bool bUseRawData=true, OnnxDefinitions.DataType dstDataType=OnnxDefinitions.DataType.FLOAT) |
Convert a MyCaffe model description, weights and optionally mean image from the MyCaffe model format to the ONNX format and save the result as a .onnx model file. More... | |
ModelProto | ConvertMyCaffeToOnnx (CudaDnn< T > cuda, Log log, MyCaffeModelData data, int nOpSetVersion=9, bool bUseRawData=true, OnnxDefinitions.DataType dstDataType=OnnxDefinitions.DataType.FLOAT) |
Convert a MyCaffe model description, weights and optionally mean image from the MyCaffe model format to the ONNX format and return the ONNX ModelProto object containing the model in the ONNX format. More... | |
ModelProto | ConvertMyCaffeToOnnx (MyCaffeControl< T > ctrl, int nOpSetVersion=9, bool bUseRawData=true, OnnxDefinitions.DataType dstDataType=OnnxDefinitions.DataType.FLOAT, Phase phase=Phase.RUN) |
Convert a model currently loaded into the MyCaffeControl to an ONNX ModelProto. More... | |
void | ConvertMyCaffeToOnnxFile (MyCaffeControl< T > ctrl, string strOnnxFile, int nOpSetVersion=9, bool bUseRawData=true, OnnxDefinitions.DataType dstDataType=OnnxDefinitions.DataType.FLOAT, Phase phase=Phase.RUN) |
Convert a model currently loaded into the MyCaffeControl to an ONNX .onnx model file. More... | |
MyCaffeModelData | ConvertOnnxToMyCaffeFromFile (CudaDnn< T > cuda, Log log, string strOnnxFile, bool bFixlupNeuronNodes=true, bool bIncludeLastLayerWeights=false, DatasetDescriptor dsTraining=null) |
Convert an ONNX .onnx model file to the MyCaffe model description, weights and optionally mean image. More... | |
MyCaffeModelData | ConvertOnnxToMyCaffe (CudaDnn< T > cuda, Log log, ModelProto onnxModel, bool bFixupNeuronNodes=true, bool bIncludeLastLayerWeights=false, DatasetDescriptor dsTraining=null) |
Convert an ONNX ModelProto to the MyCaffe model description, weights and optionally mean image. More... | |
Public Member Functions inherited from System.ComponentModel.Component | |
Component () | |
Static Public Member Functions | |
static float[] | getDataAsFloat (TensorProto tensor) |
Converts the tensor data into an array of float. More... | |
static double[] | getDataAsDouble (TensorProto tensor) |
Converts the tensor data into an array of double. More... | |
Properties | |
List< string > | IgnoreLayerNames [getset] |
Get/set the list of layer names to ignore (layers are ignored when they contain the text from one of these items). More... | |
string | ReportString [get] |
Returns the report from the conversion. More... | |
The MyCaffeConversionControl handles converting between MyCaffe and ONNX formats. The OnnxControl is used to read and write ONNX files.
T | Specifies the base type used by MyCaffe which is either float or double. |
Definition at line 35 of file MyCaffeConversionControl.cs.
The constructor.
Definition at line 52 of file MyCaffeConversionControl.cs.
MyCaffe.converter.onnx.MyCaffeConversionControl< T >.MyCaffeConversionControl | ( | IContainer | container | ) |
The constructor.
container | A container holding the component. |
Definition at line 62 of file MyCaffeConversionControl.cs.
ModelProto MyCaffe.converter.onnx.MyCaffeConversionControl< T >.ConvertMyCaffeToOnnx | ( | CudaDnn< T > | cuda, |
Log | log, | ||
MyCaffeModelData | data, | ||
int | nOpSetVersion = 9 , |
||
bool | bUseRawData = true , |
||
OnnxDefinitions.DataType | dstDataType = OnnxDefinitions.DataType.FLOAT |
||
) |
Convert a MyCaffe model description, weights and optionally mean image from the MyCaffe model format to the ONNX format and return the ONNX ModelProto object containing the model in the ONNX format.
cuda | Specifies the connection to cuda uses to interact with the GPU. |
log | Specifies the output log used to show progress. |
data | Specifies the MyCaffe model data including the model description, the weights and optionally, the image mean. |
nOpSetVersion | Specifies the Operation set version (default = 9). |
bUseRawData | Optionally, specifies whether or not to store tensor data as RawData or as the native FloatData or DoubleData (default = true). |
dstDataType | Optionally, specifies the output data type, which currently can be either FLOAT or DOUBLE (default = FLOAT). |
Definition at line 141 of file MyCaffeConversionControl.cs.
ModelProto MyCaffe.converter.onnx.MyCaffeConversionControl< T >.ConvertMyCaffeToOnnx | ( | MyCaffeControl< T > | ctrl, |
int | nOpSetVersion = 9 , |
||
bool | bUseRawData = true , |
||
OnnxDefinitions.DataType | dstDataType = OnnxDefinitions.DataType.FLOAT , |
||
Phase | phase = Phase.RUN |
||
) |
Convert a model currently loaded into the MyCaffeControl to an ONNX ModelProto.
ctrl | Specifies the MyCaffeControl object. |
nOpSetVersion | Specifies the Operation set version (default = 9). |
bUseRawData | Optionally, specifies whether or not to store tensor data as RawData or as the native FloatData or DoubleData (default = true). |
dstDataType | Optionally, specifies the output data type, which currently can be either FLOAT or DOUBLE (default = FLOAT). |
phase | Optionally, specifies the phase (which netork) to convert (default = RUN). |
Definition at line 175 of file MyCaffeConversionControl.cs.
void MyCaffe.converter.onnx.MyCaffeConversionControl< T >.ConvertMyCaffeToOnnxFile | ( | CudaDnn< T > | cuda, |
Log | log, | ||
MyCaffeModelData | data, | ||
string | strOutputFile, | ||
int | nOpSetVersion = 9 , |
||
bool | bUseRawData = true , |
||
OnnxDefinitions.DataType | dstDataType = OnnxDefinitions.DataType.FLOAT |
||
) |
Convert a MyCaffe model description, weights and optionally mean image from the MyCaffe model format to the ONNX format and save the result as a .onnx model file.
cuda | Specifies the connection to cuda uses to interact with the GPU. |
log | Specifies the output log used to show progress. |
data | Specifies the MyCaffe model data including the model description, the weights and optionally, the image mean. |
strOutputFile | Specifies the .onnx output file. |
nOpSetVersion | Specifies the Operation set version (default = 9). |
bUseRawData | Optionally, specifies whether or not to store tensor data as RawData or as the native FloatData or DoubleData (default = true). |
dstDataType | Optionally, specifies the output data type, which currently can be either FLOAT or DOUBLE (default = FLOAT). |
Definition at line 120 of file MyCaffeConversionControl.cs.
void MyCaffe.converter.onnx.MyCaffeConversionControl< T >.ConvertMyCaffeToOnnxFile | ( | MyCaffeControl< T > | ctrl, |
string | strOnnxFile, | ||
int | nOpSetVersion = 9 , |
||
bool | bUseRawData = true , |
||
OnnxDefinitions.DataType | dstDataType = OnnxDefinitions.DataType.FLOAT , |
||
Phase | phase = Phase.RUN |
||
) |
Convert a model currently loaded into the MyCaffeControl to an ONNX .onnx model file.
ctrl | Specifies the MyCaffeControl object. |
strOnnxFile | Specifies the output .onnx file. |
nOpSetVersion | Specifies the Operation set version (default = 9). |
bUseRawData | Optionally, specifies whether or not to store tensor data as RawData or as the native FloatData or DoubleData (default = true). |
dstDataType | Optionally, specifies the output data type, which currently can be either FLOAT or DOUBLE (default = FLOAT). |
phase | Optionally, specifies the phase (which netork) to convert (default = RUN). |
Definition at line 190 of file MyCaffeConversionControl.cs.
MyCaffeModelData MyCaffe.converter.onnx.MyCaffeConversionControl< T >.ConvertOnnxToMyCaffe | ( | CudaDnn< T > | cuda, |
Log | log, | ||
ModelProto | onnxModel, | ||
bool | bFixupNeuronNodes = true , |
||
bool | bIncludeLastLayerWeights = false , |
||
DatasetDescriptor | dsTraining = null |
||
) |
Convert an ONNX ModelProto to the MyCaffe model description, weights and optionally mean image.
cuda | Specifies the connection to cuda uses to interact with the GPU. |
log | Specifies the output log used to show progress. |
onnxModel | Specifies the ONNX model. |
bFixupNeuronNodes | Optionally, specifies to fixup the neuron nodes (e.g. Relu, Prelu, Elu, Sigmoid, Tahn, etc.) by connecting them to inline nodes by connnecting them back to their parent which is common in Caffe type models (default = true). |
bIncludeLastLayerWeights | Optionally, specifies to include the weights for the last layer (default = false, usually not included for transfer learning). |
dsTraining | Optionally, specifies a training dataset which when supplied converts the model to a training model where inputs are replaced with data layers, and outputs (e.g. softmax) with loss and accuracy layers (default = false). |
Definition at line 231 of file MyCaffeConversionControl.cs.
MyCaffeModelData MyCaffe.converter.onnx.MyCaffeConversionControl< T >.ConvertOnnxToMyCaffeFromFile | ( | CudaDnn< T > | cuda, |
Log | log, | ||
string | strOnnxFile, | ||
bool | bFixlupNeuronNodes = true , |
||
bool | bIncludeLastLayerWeights = false , |
||
DatasetDescriptor | dsTraining = null |
||
) |
Convert an ONNX .onnx model file to the MyCaffe model description, weights and optionally mean image.
cuda | Specifies the connection to cuda uses to interact with the GPU. |
log | Specifies the output log used to show progress. |
strOnnxFile | Specifies the ONNX .onnx file. |
bFixlupNeuronNodes | Optionally, specifies to fixup the neuron nodes (e.g. Relu, Prelu, Elu, Sigmoid, Tahn, etc.) by connecting them to inline nodes by connnecting them back to their parent which is common in Caffe type models (default = true). |
bIncludeLastLayerWeights | Optionally, specifies to include the weights for the last layer (default = false, usually not included for transfer learning). |
dsTraining | Optionally, specifies a training dataset which when supplied converts the model to a training model where inputs are replaced with data layers, and outputs (e.g. softmax) with loss and accuracy layers (default = false). |
Definition at line 209 of file MyCaffeConversionControl.cs.
|
static |
Converts the tensor data into an array of double.
tensor | Specifies the tensor to convert. |
Definition at line 1793 of file MyCaffeConversionControl.cs.
|
static |
Converts the tensor data into an array of float.
tensor | Specifies the tensor to convert. |
Definition at line 1694 of file MyCaffeConversionControl.cs.
void MyCaffe.converter.onnx.MyCaffeConversionControl< T >.SetWeightScaling | ( | double | dfMin, |
double | dfMax | ||
) |
Set the scaling factors applied to the weights.
dfMin | Specifies the minimum of the range. |
dfMax | Specifies the maximum of the range. |
Definition at line 86 of file MyCaffeConversionControl.cs.
|
getset |
Get/set the list of layer names to ignore (layers are ignored when they contain the text from one of these items).
Definition at line 95 of file MyCaffeConversionControl.cs.
|
get |
Returns the report from the conversion.
Definition at line 104 of file MyCaffeConversionControl.cs.