Commit ad453ba0 authored by Carlos Alfredo Yeverino Rodriguez's avatar Carlos Alfredo Yeverino Rodriguez
Browse files

Fixed provisional test cases

parent b3e4b00b
Pipeline #65789 failed with stages
in 13 seconds
//CAFFE2
#ifndef CNNBUFFERFILE_H #ifndef CNNBUFFERFILE_H
#define CNNBUFFERFILE_H #define CNNBUFFERFILE_H
......
<#-- CAFFE2 -->
//CAFFE2
import mxnet as mx import mxnet as mx
import logging import logging
import os import os
......
<#-- CAFFE2 -->
//CAFFE2
#ifndef ${tc.fileNameWithoutEnding?upper_case} #ifndef ${tc.fileNameWithoutEnding?upper_case}
#define ${tc.fileNameWithoutEnding?upper_case} #define ${tc.fileNameWithoutEnding?upper_case}
...@@ -16,8 +13,8 @@ class ${tc.fileNameWithoutEnding}{ ...@@ -16,8 +13,8 @@ class ${tc.fileNameWithoutEnding}{
public: public:
const std::string json_file = "model/${tc.fullArchitectureName}/${tc.architectureName}_newest-symbol.json"; const std::string json_file = "model/${tc.fullArchitectureName}/${tc.architectureName}_newest-symbol.json";
const std::string param_file = "model/${tc.fullArchitectureName}/${tc.architectureName}_newest-0000.params"; const std::string param_file = "model/${tc.fullArchitectureName}/${tc.architectureName}_newest-0000.params";
const std::vector<std::string> input_keys = {"data"}; //const std::vector<std::string> input_keys = {"data"};
//const std::vector<std::string> input_keys = {${tc.join(tc.architectureInputs, ",", "\"", "\"")}}; const std::vector<std::string> input_keys = {${tc.join(tc.architectureInputs, ",", "\"", "\"")}};
const std::vector<std::vector<mx_uint>> input_shapes = {<#list tc.architecture.inputs as input>{1,${tc.join(input.definition.type.dimensions, ",")}}<#if input?has_next>,</#if></#list>}; const std::vector<std::vector<mx_uint>> input_shapes = {<#list tc.architecture.inputs as input>{1,${tc.join(input.definition.type.dimensions, ",")}}<#if input?has_next>,</#if></#list>};
const bool use_gpu = false; const bool use_gpu = false;
...@@ -31,8 +28,8 @@ public: ...@@ -31,8 +28,8 @@ public:
if(handle) MXPredFree(handle); if(handle) MXPredFree(handle);
} }
void predict(${tc.join(tc.architectureInputs, ", ", "const vector<float> &", "")}, void predict(${tc.join(tc.architectureInputs, ", ", "const std::vector<float> &", "")},
${tc.join(tc.architectureOutputs, ", ", "vector<float> &", "")}){ ${tc.join(tc.architectureOutputs, ", ", "std::vector<float> &", "")}){
<#list tc.architectureInputs as inputName> <#list tc.architectureInputs as inputName>
MXPredSetInput(handle, "data", ${inputName}.data(), ${inputName}.size()); MXPredSetInput(handle, "data", ${inputName}.data(), ${inputName}.size());
//MXPredSetInput(handle, "${inputName}", ${inputName}.data(), ${inputName}.size()); //MXPredSetInput(handle, "${inputName}", ${inputName}.data(), ${inputName}.size());
......
//CAFFE2
#ifndef CNNBUFFERFILE_H #ifndef CNNBUFFERFILE_H
#define CNNBUFFERFILE_H #define CNNBUFFERFILE_H
......
...@@ -13,8 +13,8 @@ class CNNPredictor_Alexnet{ ...@@ -13,8 +13,8 @@ class CNNPredictor_Alexnet{
public: public:
const std::string json_file = "model/Alexnet/Alexnet_newest-symbol.json"; const std::string json_file = "model/Alexnet/Alexnet_newest-symbol.json";
const std::string param_file = "model/Alexnet/Alexnet_newest-0000.params"; const std::string param_file = "model/Alexnet/Alexnet_newest-0000.params";
const std::vector<std::string> input_keys = {"data"};
//const std::vector<std::string> input_keys = {"data"}; //const std::vector<std::string> input_keys = {"data"};
const std::vector<std::string> input_keys = {"data"};
const std::vector<std::vector<mx_uint>> input_shapes = {{1,3,224,224}}; const std::vector<std::vector<mx_uint>> input_shapes = {{1,3,224,224}};
const bool use_gpu = false; const bool use_gpu = false;
...@@ -28,8 +28,8 @@ public: ...@@ -28,8 +28,8 @@ public:
if(handle) MXPredFree(handle); if(handle) MXPredFree(handle);
} }
void predict(const vector<float> &data, void predict(const std::vector<float> &data,
vector<float> &predictions){ std::vector<float> &predictions){
MXPredSetInput(handle, "data", data.data(), data.size()); MXPredSetInput(handle, "data", data.data(), data.size());
//MXPredSetInput(handle, "data", data.data(), data.size()); //MXPredSetInput(handle, "data", data.data(), data.size());
......
...@@ -13,8 +13,8 @@ class CNNPredictor_CifarClassifierNetwork{ ...@@ -13,8 +13,8 @@ class CNNPredictor_CifarClassifierNetwork{
public: public:
const std::string json_file = "model/CifarClassifierNetwork/CifarClassifierNetwork_newest-symbol.json"; const std::string json_file = "model/CifarClassifierNetwork/CifarClassifierNetwork_newest-symbol.json";
const std::string param_file = "model/CifarClassifierNetwork/CifarClassifierNetwork_newest-0000.params"; const std::string param_file = "model/CifarClassifierNetwork/CifarClassifierNetwork_newest-0000.params";
const std::vector<std::string> input_keys = {"data"};
//const std::vector<std::string> input_keys = {"data"}; //const std::vector<std::string> input_keys = {"data"};
const std::vector<std::string> input_keys = {"data"};
const std::vector<std::vector<mx_uint>> input_shapes = {{1,3,32,32}}; const std::vector<std::vector<mx_uint>> input_shapes = {{1,3,32,32}};
const bool use_gpu = false; const bool use_gpu = false;
...@@ -28,8 +28,8 @@ public: ...@@ -28,8 +28,8 @@ public:
if(handle) MXPredFree(handle); if(handle) MXPredFree(handle);
} }
void predict(const vector<float> &data, void predict(const std::vector<float> &data,
vector<float> &softmax){ std::vector<float> &softmax){
MXPredSetInput(handle, "data", data.data(), data.size()); MXPredSetInput(handle, "data", data.data(), data.size());
//MXPredSetInput(handle, "data", data.data(), data.size()); //MXPredSetInput(handle, "data", data.data(), data.size());
......
...@@ -13,8 +13,8 @@ class CNNPredictor_VGG16{ ...@@ -13,8 +13,8 @@ class CNNPredictor_VGG16{
public: public:
const std::string json_file = "model/VGG16/VGG16_newest-symbol.json"; const std::string json_file = "model/VGG16/VGG16_newest-symbol.json";
const std::string param_file = "model/VGG16/VGG16_newest-0000.params"; const std::string param_file = "model/VGG16/VGG16_newest-0000.params";
const std::vector<std::string> input_keys = {"data"};
//const std::vector<std::string> input_keys = {"data"}; //const std::vector<std::string> input_keys = {"data"};
const std::vector<std::string> input_keys = {"data"};
const std::vector<std::vector<mx_uint>> input_shapes = {{1,3,224,224}}; const std::vector<std::vector<mx_uint>> input_shapes = {{1,3,224,224}};
const bool use_gpu = false; const bool use_gpu = false;
...@@ -28,8 +28,8 @@ public: ...@@ -28,8 +28,8 @@ public:
if(handle) MXPredFree(handle); if(handle) MXPredFree(handle);
} }
void predict(const vector<float> &data, void predict(const std::vector<float> &data,
vector<float> &predictions){ std::vector<float> &predictions){
MXPredSetInput(handle, "data", data.data(), data.size()); MXPredSetInput(handle, "data", data.data(), data.size());
//MXPredSetInput(handle, "data", data.data(), data.size()); //MXPredSetInput(handle, "data", data.data(), data.size());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment