yizt / keras-ctpn

keras复现场景文本检测网络CPTN: 《Detecting Text in Natural Image with Connectionist Text Proposal Network》;欢迎试用,关注,并反馈问题...
Apache License 2.0
107 stars 38 forks source link

debug code #11

Open hcnhatnam opened 5 years ago

hcnhatnam commented 5 years ago

@yizt How to debug function like ctpn_target_graph() in target.py?I used pycharm to debug but value =tensor()...I want to see the specific values when putting an image into the network.

yizt commented 5 years ago

@hcnhatnam 在train.py 中增加如下代码; 然后在命令行中:pt <tensor> 输出张量值

    from tensorflow.python import debug as tf_debug
    import keras.backend as K

    sess = K.get_session()
    sess = tf_debug.LocalCLIDebugWrapperSession(sess)
    K.set_session(sess)
RabbearSu commented 5 years ago

@hcnhatnam you can use the eager mode of tensorflow. tf.enable_eager_execution(), then you can directly get the value.