का उपयोग कर रहा TensorFlow की गणना/स्मृति उपयोग प्रोफ़ाइल कोशिश कर रहा हूँ और पाया कि tfprof मेरा उद्देश्य के लिए एक सही उपकरण है। हालांकि, मैं सभी ऑपरेटरों के फ्लॉप प्राप्त करने में सक्षम नहीं था।रूपरेखा TensorFlow tfprof
यहाँ मैं TensorFlow भंडार में cifar10 ट्यूटोरियल का उपयोग tfprof ट्यूटोरियल निम्नलिखित क्या किया है (tensorflow/मॉडल/छवि/cifar10/cifar10_train.py):
run_metadata = tf.RunMetadata()
_, loss_value = sess.run([train_op, loss],
options=tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE),
run_metadata=run_metadata)
op_log = tfprof_log_pb2.OpLog()
// TODO: add op information
tf.contrib.tfprof.tfprof_logger.write_op_log(
tf.get_default_graph(),
log_dir="/tmp/log_dir",
op_log=op_log,
run_meta=run_metadata)
tf.contrib.tfprof.model_analyzer.print_model_analysis(
tf.get_default_graph(),
run_metadata=run_metadata,
op_log=op_log,
tfprof_options=tf.contrib.tfprof.model_analyzer.FLOAT_OPS_OPTIONS)
और परिणाम
Parsing GraphDef...
Parsing RunMetadata...
Parsing OpLog...
Preparing Views...
=========================Options=============================
-max_depth 10000
-min_bytes 0
-min_micros 0
-min_params 0
-min_float_ops 1
-device_regexes .*
-order_by float_ops
-account_type_regexes .*
-start_name_regexes .*
-trim_name_regexes
-show_name_regexes .*
-hide_name_regexes
-account_displayed_op_only true
-select float_ops
-viz false
-dump_to_file
==================Model Analysis Report======================
_TFProfRoot (0/5.23b flops)
conv2/Conv2D (3.77b/3.77b flops)
conv1/Conv2D (707.79m/707.79m flops)
gradients/local3/MatMul_grad/MatMul (226.49m/226.49m flops)
gradients/local3/MatMul_grad/MatMul_1 (226.49m/226.49m flops)
local3/MatMul (226.49m/226.49m flops)
gradients/local4/MatMul_grad/MatMul (18.87m/18.87m flops)
gradients/local4/MatMul_grad/MatMul_1 (18.87m/18.87m flops)
local4/MatMul (18.87m/18.87m flops)
conv1/BiasAdd (4.72m/4.72m flops)
conv2/BiasAdd (1.18m/1.18m flops)
gradients/softmax_linear/MatMul_grad/MatMul (491.52k/491.52k flops)
gradients/softmax_linear/MatMul_grad/MatMul_1 (491.52k/491.52k flops)
softmax_linear/MatMul (491.52k/491.52k flops)
======================End of Report==========================
है
हालांकि, परिणाम में सभी ऑप शामिल नहीं हैं जैसे अधिकतम पूलिंग, रिले, कॉन्फ़ लेयर के ढाल। हो सकता है कि उन ओप के आंकड़े फ्लॉप को परिभाषित नहीं किया गया है (रजिस्टरस्टैटिक्स ('फ्लॉप'))। इसलिए, tfprof ट्यूटोरियल 11 में रनटाइम जानकारी प्रदान करने के लिए, मैंने OpLog
(उपरोक्त कोड देखें) बनाने की कोशिश की।
हालांकि, मुझे यकीन है कि मैं कैसे सेशन जानकारी जोड़ सकते हैं नहीं कर रहा हूँ (मैं ऑप्स के प्रवेश नाम कैसे प्राप्त कर सकते हैं?)। क्या सभी जोड़ने के लिए कोई तरीका है?
या बल्कि tfprof के अलावा कोई अन्य उपकरण? शायद एनवीआईडीआईए से उपकरण का प्रोफाइलिंग?
उन ऑप्स के लिए, यहां तक कि OpLog और runtime_meta फ्लॉप स्टेट प्रदान नहीं करता है? – enc