File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,22 @@ def predict_input_fn():
104104 for result in predictions :
105105 tf_feed .batch_results ([result ])
106106
107+ # WORKAROUND FOR https://github.com/tensorflow/tensorflow/issues/21745
108+ # wait for all other nodes to complete (via done files)
109+ done_dir = "{}/{}/done" .format (ctx .absolute_path (args .model ), args .mode )
110+ print ("Writing done file to: {}" .format (done_dir ))
111+ tf .gfile .MakeDirs (done_dir )
112+ with tf .gfile .GFile ("{}/{}" .format (done_dir , ctx .task_index ), 'w' ) as done_file :
113+ done_file .write ("done" )
114+
115+ for i in range (60 ):
116+ if len (tf .gfile .ListDirectory (done_dir )) < len (ctx .cluster_spec ['worker' ]):
117+ print ("{} Waiting for other nodes {}" .format (datetime .now ().isoformat (), i ))
118+ time .sleep (1 )
119+ else :
120+ print ("{} All nodes done" .format (datetime .now ().isoformat ()))
121+ break
122+
107123
108124if __name__ == '__main__' :
109125 import argparse
Original file line number Diff line number Diff line change 55 <modelVersion >4.0.0</modelVersion >
66 <groupId >com.yahoo.ml</groupId >
77 <artifactId >tensorflowonspark</artifactId >
8- <version >1.0</version >
8+ <version >1.0.1 </version >
99 <packaging >jar</packaging >
1010 <name >tensorflowonspark</name >
1111 <description >Spark Scala inferencing for TensorFlowOnSpark</description >
2525 <json4s-native .version>3.5.3</json4s-native .version>
2626 <maven-shade-plugin .version>2.1</maven-shade-plugin .version>
2727 <maven-surefire-plugin .version>2.20.1</maven-surefire-plugin .version>
28- <spark .version>2.1.0 </spark .version>
28+ <spark .version>[2.2.0,) </spark .version>
2929 <scala .version>2.11.8</scala .version>
3030 <scala-maven-plugin .version>3.2.1</scala-maven-plugin .version>
3131 <scala-parser-combinators .version>1.1.0</scala-parser-combinators .version>
You can’t perform that action at this time.
0 commit comments