Merge branch 'master' of https://github.com/ceccocats/tkDNN into eval

This commit is contained in:
Micaela Verucchi
2020-05-11 11:58:51 +02:00
7 changed files with 404 additions and 53 deletions
+11 -15
View File
@@ -7,26 +7,18 @@ const char *i2_bin = "imuodom/layers/input2.bin";
const char *o0_bin = "imuodom/layers/output0.bin";
const char *o1_bin = "imuodom/layers/output1.bin";
const char *c0_bin = "imuodom/layers/conv1d_7.bin";
const char *c1_bin = "imuodom/layers/conv1d_8.bin";
const char *c2_bin = "imuodom/layers/conv1d_9.bin";
const char *c3_bin = "imuodom/layers/conv1d_10.bin";
const char *c4_bin = "imuodom/layers/conv1d_11.bin";
const char *c5_bin = "imuodom/layers/conv1d_12.bin";
const char *l0_bin = "imuodom/layers/bidirectional_3.bin";
const char *l1_bin = "imuodom/layers/bidirectional_4.bin";
const char *d0_bin = "imuodom/layers/dense_3.bin";
const char *d1_bin = "imuodom/layers/dense_4.bin";
int main() {
// V1
downloadWeightsifDoNotExist(i0_bin, "imuodom", "https://cloud.hipert.unimore.it/s/ZAy34K5w2ixED6x/download");
// V2
//downloadWeightsifDoNotExist(i0_bin, "imuodom", "https://cloud.hipert.unimore.it/s/BBSEbEbQbPKxp4s/download");
tk::dnn::ImuOdom ImuNet;
ImuNet.init("imuodom/layers/");
const int N = 10000; //19513;
const int N = 19513;
// Network layout
tk::dnn::dataDim_t dim0(1, 4, 1, 100);
@@ -60,7 +52,9 @@ int main() {
//TIMER_STOP
// log path
path<<ImuNet.odomPOS(0)<<" "<<ImuNet.odomPOS(1)<<" "<< ImuNet.odomPOS(2)<<"\n";
path<<ImuNet.odomPOS(0)<<" "<<ImuNet.odomPOS(1)<<" "<< ImuNet.odomPOS(2)<<" ";
path<<ImuNet.odomEULER(0)<<" "<<ImuNet.odomEULER(1)<<" "<< ImuNet.odomEULER(2)<<"\n";
path.flush();
// Print real test
@@ -77,6 +71,8 @@ int main() {
out1 += ImuNet.odim1.tot();
}
system("cat path.txt | gnuplot -p -e \"set datafile separator ' '; plot '-'\"");
int err = 0;
err = system("cat path.txt | cut -d\" \" -f1,2 | gnuplot -p -e \"set datafile separator ' '; plot '-'\"");
err = system("cat path.txt | cut -d\" \" -f6 | gnuplot -p -e \"set datafile separator ' '; plot '-'\"");
return ret_cudnn;
}
+4 -4
View File
@@ -16,14 +16,14 @@ def bin_write(f, data):
bin = struct.pack(fmt, *data)
f.write(bin)
# USE weight_exporter to generare wgs bins
if __name__ == '__main__':
print("DATA FORMAT: ", keras.backend.image_data_format())
print("Load model: ", "ferrariS1.hdf5")
model = load_model("ferrariS1.hdf5")
print("Load model: ", "ferrariSEP.hdf5")
model = load_model("ferrariSEP.hdf5")
model.summary()
weights = model.get_weights()