2017-06-14 16 views
1

私はログインtensorflowして、次の行を見つけ見直しています:ログにTensorflow "不完全な形状"とはどういう意味ですか?

GRUと似たような状況で

for op in graph.get_operations(): try: stats = ops.get_stats_for_node_def( graph, op.node_def, REGISTERED_FLOP_STATS) except ValueError: # Catch Exception When shape is incomplete. Skip it. op_missing_shape += 1 stats = None ...... if op_missing_shape > 0 and not run_meta: sys.stderr.write('%d ops no flops stats due to incomplete shapes.\n' % op_missing_shape)

、この行:

4 ops no flops stats due to incomplete shapes. Consider passing run_meta to use run_time shapes. 

このメッセージはfollowing codeから来ているように見えるが表示されません。だから私はエラーがバッチサイズによって引き起こされないと仮定します。それは何であるか説明していただけますか?また、 "run_meta"属性をどのように追加するのですか?ありがとう。

答えて

2

'...不完全な形状による統計情報がありません'とは、いくつかの変数に不明な[形状]情報があることを意味します。あなたが可変のバッチサイズ([なし]形状)、または任意の時間のためのtf.while_loopなど公式tfprofドキュメントにしたがって

source)を処理する場合:

  • をすることが知られている必要があります統計を計算するためのRegisterStatistics( 'flops')の「形状」情報 ランタイム中にのみ形状がわかっている場合は が-run_meta_pathに渡されることが提案されています。 tfprofはRunMetadataからの実行時の形状 の情報で不足している形状を埋めることができます。 RunMetadata用として

、あなたが必要なものでなければなりませんtensorflowでtf.RunMetadata() opが、そこにあります。通常、それをsess.run()に渡します。

実行時にすべてのシェイプが定義されるときにRunMetadataを渡すことです。

# Generate the RunMetadata that contains the memory and timing information. 
# 
# Note: When run on GPU, a kernel is first scheduled (enqueued) and then 
#  executed asynchronously. tfprof only tracks the execution time. 
# 
run_metadata = tf.RunMetadata() 
with tf.Session() as sess: 
    _ = sess.run(train_op, 
       options=tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE), 
       run_metadata=run_metadata) 

これが役に立ちます。

関連する問題