Docker api #242
@@ -1,6 +1,7 @@
|
|||||||
#ifndef NETWORK_H
|
#ifndef NETWORK_H
|
||||||
#define NETWORK_H
|
#define NETWORK_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
namespace tk { namespace dnn {
|
namespace tk { namespace dnn {
|
||||||
@@ -62,6 +63,8 @@ public:
|
|||||||
|
|
||||||
bool fp16, dla, int8;
|
bool fp16, dla, int8;
|
||||||
bool dontLoadWeights;
|
bool dontLoadWeights;
|
||||||
|
std::string fileImgList;
|
||||||
|
std::string fileLabelList;
|
||||||
};
|
};
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ Network::Network(dataDim_t input_dim) {
|
|||||||
int8 = true;
|
int8 = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(const char* env_p = std::getenv("TKDNN_CALIB_IMG_PATH"))
|
||||||
|
fileImgList = env_p;
|
||||||
|
|
||||||
|
if(const char* env_p = std::getenv("TKDNN_CALIB_LABEL_PATH"))
|
||||||
|
fileLabelList = env_p;
|
||||||
|
|
||||||
|
|
||||||
if(fp16)
|
if(fp16)
|
||||||
std::cout<<COL_REDB<<"!! FP16 INFERENCE ENABLED !!"<<COL_END<<"\n";
|
std::cout<<COL_REDB<<"!! FP16 INFERENCE ENABLED !!"<<COL_END<<"\n";
|
||||||
|
|||||||
+1
-2
@@ -73,8 +73,7 @@ NetworkRT::NetworkRT(Network *net, const char *name) {
|
|||||||
// builderRT->setInt8Mode(true);
|
// builderRT->setInt8Mode(true);
|
||||||
configRT->setFlag(BuilderFlag::kINT8);
|
configRT->setFlag(BuilderFlag::kINT8);
|
||||||
BatchStream calibrationStream(dim, 1, 100, //TODO: check if 100 images are sufficient to the calibration (or 4951)
|
BatchStream calibrationStream(dim, 1, 100, //TODO: check if 100 images are sufficient to the calibration (or 4951)
|
||||||
"/home/xavier/Documents/tkDNN/demo/COCO_val2017/all_images.txt",
|
net->fileImgList, net->fileLabelList);
|
||||||
"/home/xavier/Documents/tkDNN/demo/COCO_val2017/all_labels.txt");
|
|
||||||
std::string modelName = name;
|
std::string modelName = name;
|
||||||
calibrator.reset(new Int8EntropyCalibrator(calibrationStream, 1,
|
calibrator.reset(new Int8EntropyCalibrator(calibrationStream, 1,
|
||||||
"./" + modelName.substr(0, modelName.find('.')) + "-calibration.table",
|
"./" + modelName.substr(0, modelName.find('.')) + "-calibration.table",
|
||||||
|
|||||||
Reference in New Issue
Block a user