如何在批处理模式下显示错误消息?

时间:2018-10-09 15:57:57

标签: python python-3.x cmd knime

我试图在(Windows 10)cmd / Python 3中执行KNIME.exe。但是,当出现错误消息时,我总是得到一个弹出窗口,而不是在cmd / Jupyter Notebook中显示它们。

问题:有什么方法可以直接在cmd / Python中看到错误消息,而不是具有弹出窗口?

我目前所拥有的: enter image description here

我的cmd命令(故意打错“ -reset”):

X=tf.placeholder(tf.float32,[None,32,32,3])
y=tf.placeholder(tf.int64,[None])
is_training=tf.placeholder(tf.bool)

def simple_model(X,y):

    Wconv1=tf.get_variable("Wconv1",shape=[7,7,3,32],use_resource=True)
    bconv1=tf.get_variable('bconv1',shape=[32])
    W1=tf.get_variable('W1',shape=[5408,10])
    b1=tf.get_variable('b1',shape=[10])

    a1=tf.nn.conv2d(X,Wconv1,[1,2,2,1],'VALID')+bconv1
    h1=tf.nn.relu(a1)

    h1_flat=tf.reshape(h1,[-1,5408])
    y_out=tf.matmul(h1_flat,W1)+b1
    return y_out

my_model = simple_model(X,y)
init=tf.global_variables_initializer()

with tf.Session() as sess:
    sess.run(init)

    sess.run(my_model, feed_dict={X:X_train,y:y_train})

在Python中,我只是使用knime.exe -noexit -consoleLog -nosplash –application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="C:\Users\username\knime-workspace\cmd_test" -reset 来调用同一命令。我有相同的弹出窗口。

我经历过的来源:
https://forum.knime.com/t/is-there-a-way-to-execute-knime-workflows-with-python/12174/3?u=howellyu
https://www.knime.com/faq

请让我知道您的想法。谢谢!
-H

0 个答案:

没有答案