Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
33bdb384
Commit
33bdb384
authored
Sep 20, 2018
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing
parent
cd9b6096
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
10 deletions
+24
-10
TensorflowExamplePlugin.java
src/main/java/TensorflowExamplePlugin.java
+24
-10
No files found.
src/main/java/TensorflowExamplePlugin.java
View file @
33bdb384
...
...
@@ -145,20 +145,24 @@ public class TensorflowExamplePlugin
System
.
out
.
println
(
opr
.
toString
());
System
.
out
.
println
(
"S1:"
);
//opr = bundle.graph().operation("rv_stageY_out");
//System.out.println(opr.toString());
// init variable via constant?
Tensor
<
Float
>
tsr
=
toTensor2DFloat
(
rv_stage1_out
,
tensorsToClose
);
//Tensor<Float> tsr = toTensor2DFloat(rv_stage1_out, tensorsToClose);
/*
Output builder_init = bundle.graph()
.opBuilder("Const", "rv_stage1_out_init")
.setAttr ("dtype", tsr.dataType())
.setAttr ("value", tsr)
.build()
.output(0);
System
.
out
.
println
(
builder_init
);
*/
//
System.out.println(builder_init);
// variable
OperationBuilder
builder2
=
bundle
.
graph
().
opBuilder
(
"Variable"
,
"rv_stage1_out_extra_variable"
);
//
OperationBuilder builder2 = bundle.graph().opBuilder("Variable", "rv_stage1_out_extra_variable");
//.addInput(builder_init);
//builder2.
...
...
@@ -169,9 +173,13 @@ public class TensorflowExamplePlugin
//System.out.println(oValue);
//Output oValue = bundle.graph().opBuilder("Variable", "rv_stage1_out").setAttr("value", tensorVal).build().output(0);
//bundle.graph().opBuilder("Assign", "Assign/rv_stage1_out").setAttr("value", tsr).build();
System
.
out
.
println
(
"DONE"
);
System
.
out
.
println
(
"Stage 0.1"
);
//bundle.session().runner().fetch("rv_stageY_out").run();
System
.
out
.
println
(
"Stage 0.2"
);
bundle
.
session
().
runner
().
fetch
(
"rv_stage1_out"
).
run
();
System
.
out
.
println
(
"Stage 1"
);
// stage 1
bundle
.
session
().
runner
()
.
feed
(
"ph_corr2d"
,
toTensor2DFloat
(
img_corr2d
,
tensorsToClose
))
...
...
@@ -181,17 +189,23 @@ public class TensorflowExamplePlugin
.
run
()
.
get
(
0
);
System
.
out
.
println
(
"Stage 1 DONE"
);
System
.
out
.
println
(
"Stage 2"
);
// stage 2
final
Tensor
<?>
result
=
bundle
.
session
().
runner
()
.
feed
(
"ph_ntile"
,
toTensor1DInt
(
img_ntile
,
tensorsToClose
))
.
feed
(
"ph_ntile
_out
"
,
toTensor1DInt
(
img_ntile
,
tensorsToClose
))
.
fetch
(
"Disparity_net/stage2_out_sparse:0"
)
.
run
()
.
get
(
0
);
tensorsToClose
.
add
(
result
);
System
.
out
.
println
(
"Stage 2 DONE: "
+
result
.
shape
()
);
float
[]
resultValues
=
(
float
[])
result
.
copyTo
(
new
float
[
78408
]
);
tensorsToClose
.
add
(
result
);
System
.
out
.
println
(
"Copy result to variable"
);
float
[][]
resultValues
=
(
float
[][])
result
.
copyTo
(
new
float
[
78408
][
1
]);
System
.
out
.
println
(
"DONE"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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