Open thnkinbtfly opened 3 years ago
Add followings:
Tested with enet_coco (I removed dropout layers from the original enet_coco.cfg)
git clone the tkDNN forked darknet.
git apply following patch file to the forked darknet. Note that if you don't change the BN epsilon (#167), the final output will fail to be similar.
diff --git a/src/blas.c b/src/blas.c index 7bfc752..8d3ddd8 100644 --- a/src/blas.c +++ b/src/blas.c @@ -289,7 +289,7 @@ void normalize_cpu(float *x, float *mean, float *variance, int batch, int filter for(f = 0; f < filters; ++f){ for(i = 0; i < spatial; ++i){ int index = b*filters*spatial + f*spatial + i; - x[index] = (x[index] - mean[f])/(sqrt(variance[f] + .000001f)); + x[index] = (x[index] - mean[f])/(sqrt(variance[f] + .00001f)); } } } diff --git a/src/darknet.c b/src/darknet.c index f7d6a81..21b0f83 100644 --- a/src/darknet.c +++ b/src/darknet.c @@ -506,6 +506,9 @@ void run_export(char *cfgfile, char *weightfile, char *out) } else if(l.type == SHORTCUT) { printf("export SHORTCUT\n"); // no weights + } else if(l.type == SCALE_CHANNELS) { + printf("export SCALE_CHANNELS\n"); + // no weights } else if(l.type == ROUTE) { printf("export ROUTE\n"); // no weights @@ -515,6 +518,9 @@ void run_export(char *cfgfile, char *weightfile, char *out) } else if(l.type == MAXPOOL) { printf("export MAXPOOL\n"); // no weights + } else if(l.type == AVGPOOL) { + printf("export AVGPOOL\n"); + // no weights } else if(l.type == REORG || l.type == REORG_OLD) { printf("export REORG\n"); // no weights
download enet-coco weights from official darknet repo
follow the steps to generate weights and input/outputs. Example : ./darknet export ../tkDNN/tests/darknet/cfg/enet-coco-wo-dropout.cfg enetb0-coco_final.weights layers
./darknet export ../tkDNN/tests/darknet/cfg/enet-coco-wo-dropout.cfg enetb0-coco_final.weights layers
build tkDNN and
cd build mkdir enet_coco_wo_dropout cp -r ../../darknet/layers enet_coco_wo_dropout/ && cp -r ../../darknet/debug enet_coco_wo_dropout ./test_enet_coco_wo_dropout
Added Features
Add followings:
Tested with enet_coco (I removed dropout layers from the original enet_coco.cfg)
Reproduce test with enet_coco
git clone the tkDNN forked darknet.
git apply following patch file to the forked darknet. Note that if you don't change the BN epsilon (#167), the final output will fail to be similar.
download enet-coco weights from official darknet repo
follow the steps to generate weights and input/outputs. Example :
./darknet export ../tkDNN/tests/darknet/cfg/enet-coco-wo-dropout.cfg enetb0-coco_final.weights layers
build tkDNN and