Commit 01835309 authored by Nicola Gatto's avatar Nicola Gatto

Make data_paths.txt optional

parent 4c82b947
...@@ -228,12 +228,14 @@ public class EMADLGenerator { ...@@ -228,12 +228,14 @@ public class EMADLGenerator {
String b = backend.getBackendString(backend); String b = backend.getBackendString(backend);
String trainingDataHash = ""; String trainingDataHash = "";
String testDataHash = ""; String testDataHash = "";
if(b.equals("CAFFE2")){ if (architecture.get().getDataPath() != null) {
trainingDataHash = getChecksumForFile(architecture.get().getDataPath() + "/train_lmdb/data.mdb"); if (b.equals("CAFFE2")) {
testDataHash = getChecksumForFile(architecture.get().getDataPath() + "/test_lmdb/data.mdb"); trainingDataHash = getChecksumForFile(architecture.get().getDataPath() + "/train_lmdb/data.mdb");
}else{ testDataHash = getChecksumForFile(architecture.get().getDataPath() + "/test_lmdb/data.mdb");
trainingDataHash = getChecksumForFile(architecture.get().getDataPath() + "/train.h5"); } else {
testDataHash = getChecksumForFile(architecture.get().getDataPath() + "/test.h5"); trainingDataHash = getChecksumForFile(architecture.get().getDataPath() + "/train.h5");
testDataHash = getChecksumForFile(architecture.get().getDataPath() + "/test.h5");
}
} }
String trainingHash = emadlHash + "#" + cnntHash + "#" + trainingDataHash + "#" + testDataHash; String trainingHash = emadlHash + "#" + cnntHash + "#" + trainingDataHash + "#" + testDataHash;
...@@ -360,8 +362,14 @@ public class EMADLGenerator { ...@@ -360,8 +362,14 @@ public class EMADLGenerator {
EMADLCocos.checkAll(componentInstanceSymbol); EMADLCocos.checkAll(componentInstanceSymbol);
if (architecture.isPresent()){ if (architecture.isPresent()){
DataPathConfigParser newParserConfig = new DataPathConfigParser(getModelsPath() + "data_paths.txt"); String dPath = null;
String dPath = newParserConfig.getDataPath(EMAComponentSymbol.getFullName()); Path dataPathDefinition = Paths.get(getModelsPath(), "data_paths.txt");
if (dataPathDefinition.toFile().exists()) {
DataPathConfigParser newParserConfig = new DataPathConfigParser(getModelsPath() + "data_paths.txt");
dPath = newParserConfig.getDataPath(EMAComponentSymbol.getFullName());
} else {
Log.warn("No data path definition found in " + dataPathDefinition + " found: No generation of data loader");
}
/*String dPath = DataPathConfigParser.getDataPath(getModelsPath() + "data_paths.txt", componentSymbol.getFullName());*/ /*String dPath = DataPathConfigParser.getDataPath(getModelsPath() + "data_paths.txt", componentSymbol.getFullName());*/
architecture.get().setDataPath(dPath); architecture.get().setDataPath(dPath);
......
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