Batchnorm eps fix, works on jetpack 4.3

This commit is contained in:
xavier
2020-01-15 18:06:02 +01:00
parent 57d7743f7e
commit c32a0be257
5 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ dnnType* Conv2d::infer(dataDim_t &dim, dnnType* srcData) {
dstTensorDesc, dstData, dstTensorDesc,
dstData, biasTensorDesc, //same tensor descriptor as bias
scales_d, bias_d, mean_d, variance_d,
CUDNN_BN_MIN_EPSILON);
TKDNN_BN_MIN_EPSILON);
}
//update data dimensions
dim = output_dim;
+1 -1
View File
@@ -29,7 +29,7 @@ LayerWgs::LayerWgs(Network *net, int inputs, int outputs,
seek += outputs;
readBinaryFile(weights_path.c_str(), outputs, &variance_h, &variance_d, seek);
float eps = CUDNN_BN_MIN_EPSILON;
float eps = TKDNN_BN_MIN_EPSILON;
power_h = new dnnType[outputs];
for(int i=0; i<outputs; i++) power_h[i] = 1.0f;
+5 -4
View File
@@ -17,10 +17,6 @@ Network::Network(dataDim_t input_dim) {
<<", CUDNN v"<<cu_ver<<")\n";
dataType = CUDNN_DATA_FLOAT;
tensorFormat = CUDNN_TENSOR_NCHW;
checkCUDNN( cudnnCreate(&cudnnHandle) );
checkERROR( cublasCreate(&cublasHandle) );
num_layers = 0;
fp16 = false;
@@ -38,6 +34,11 @@ Network::Network(dataDim_t input_dim) {
std::cout<<COL_REDB<<"!! FP16 INERENCE ENABLED !!"<<COL_END<<"\n";
if(dla)
std::cout<<COL_GREENB<<"!! DLA INERENCE ENABLED !!"<<COL_END<<"\n";
checkCUDNN( cudnnCreate(&cudnnHandle) );
checkERROR( cublasCreate(&cublasHandle) );
}
Network::~Network() {