Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMADL2CPP
Commits
01835309
Commit
01835309
authored
Apr 10, 2019
by
Nicola Gatto
Browse files
Make data_paths.txt optional
parent
4c82b947
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/emadl/generator/EMADLGenerator.java
View file @
01835309
...
...
@@ -228,12 +228,14 @@ public class EMADLGenerator {
String
b
=
backend
.
getBackendString
(
backend
);
String
trainingDataHash
=
""
;
String
testDataHash
=
""
;
if
(
b
.
equals
(
"CAFFE2"
)){
trainingDataHash
=
getChecksumForFile
(
architecture
.
get
().
getDataPath
()
+
"/train_lmdb/data.mdb"
);
testDataHash
=
getChecksumForFile
(
architecture
.
get
().
getDataPath
()
+
"/test_lmdb/data.mdb"
);
}
else
{
trainingDataHash
=
getChecksumForFile
(
architecture
.
get
().
getDataPath
()
+
"/train.h5"
);
testDataHash
=
getChecksumForFile
(
architecture
.
get
().
getDataPath
()
+
"/test.h5"
);
if
(
architecture
.
get
().
getDataPath
()
!=
null
)
{
if
(
b
.
equals
(
"CAFFE2"
))
{
trainingDataHash
=
getChecksumForFile
(
architecture
.
get
().
getDataPath
()
+
"/train_lmdb/data.mdb"
);
testDataHash
=
getChecksumForFile
(
architecture
.
get
().
getDataPath
()
+
"/test_lmdb/data.mdb"
);
}
else
{
trainingDataHash
=
getChecksumForFile
(
architecture
.
get
().
getDataPath
()
+
"/train.h5"
);
testDataHash
=
getChecksumForFile
(
architecture
.
get
().
getDataPath
()
+
"/test.h5"
);
}
}
String
trainingHash
=
emadlHash
+
"#"
+
cnntHash
+
"#"
+
trainingDataHash
+
"#"
+
testDataHash
;
...
...
@@ -360,8 +362,14 @@ public class EMADLGenerator {
EMADLCocos
.
checkAll
(
componentInstanceSymbol
);
if
(
architecture
.
isPresent
()){
DataPathConfigParser
newParserConfig
=
new
DataPathConfigParser
(
getModelsPath
()
+
"data_paths.txt"
);
String
dPath
=
newParserConfig
.
getDataPath
(
EMAComponentSymbol
.
getFullName
());
String
dPath
=
null
;
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());*/
architecture
.
get
().
setDataPath
(
dPath
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment