2017-12-15 114 views
8

मैं टेन्सफोर्लो संस्करण 1.4 के साथ काम कर रहा हूं, और मैं अपना train() फ़ंक्शन डीबग करना चाहता हूं।Tensorflow में tf.estimator पर tensorflow डीबगिंग टूल tfdbg का उपयोग कैसे करें?

इस लिंक https://www.tensorflow.org/programmers_guide/debugger#debugging_tf-learn_estimators_and_experiments

वहाँ

में tf.contrib.learn Estimators के लिए यह करने के लिए एक रास्ता है, लेकिन मैं tf.estimator (संस्करण 1.4 में नया) के लिए यह अनुकूल करने के लिए एक तरह से नहीं मिल रहा।

यह है कि मैं क्या करने की कोशिश की है:

from tensorflow.python import debug as tf_debug 

# Create an estimator 
my_estimator = tf.estimator.Estimator(model_fn=model_fn, 
             params=model_params, 
             model_dir='/tb_dir', 
             config=config_estimator) 

# Create a LocalCLIDebugHook and use it as a hook when calling train(). 
hooks = [tf_debug.LocalCLIDebugHook()] 

# Train 
my_estimator.train(input_fn=train_input_fn, steps=10,hooks=hooks) 

लेकिन मैं इस त्रुटि में चल रहा हूँ:

> --------------------------------------------------------------------------- error 
Traceback (most recent call 
> last) <ipython-input-14-71325f3c8f14> in <module>() 
>  7 
>  8 # Train 
> ----> 9 my_estimator.train(input_fn=train_input_fn, steps=10,hooks=hooks) 
> 
[...] 
> 
> /root/anaconda3/lib/python3.6/site-packages/tensorflow/python/debug/cli/curses_ui.py 
> in _screen_launch(self, enable_mouse_on_start) 
>  443 
>  444  curses.noecho() 
> --> 445  curses.cbreak() 
>  446  self._stdscr.keypad(1) 
>  447 
> 
> error: cbreak() returned ERR 

कोई सही दिशा में मुझे बात कर सकते हैं?

उत्तर

2

डिफ़ॉल्ट कमांड लाइन में काम करने के लिए सेट किया गया है, यदि आप आईडीआई का उपयोग करते हैं जैसे कि पिचर्म सबसे आसान समाधान यूआई प्रकार को बदलना है।

प्रयास करें:

hooks = [tf_debug.LocalCLIDebugHook(ui_type="readline")] 

के बजाय:

hooks = [tf_debug.LocalCLIDebugHook()]  

आप Pycharm का उपयोग मामले में, करने के लिए कॉन्फ़िगरेशन पैरामीटर --debug

+0

मैं एक Jupyter नोटबुक के साथ काम कर रहा हूँ, और हाँ जोड़ने यह आपके समाधान के साथ काम कर रहा है। धन्यवाद –