Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何防止powershell处理stderr_Powershell_Caffe_Stderr - Fatal编程技术网

如何防止powershell处理stderr

如何防止powershell处理stderr,powershell,caffe,stderr,Powershell,Caffe,Stderr,我正在使用powershell运行可执行文件(caffe.exe)。输出由glog提供,它被写入stderr而不是stdout。因此,如果我将stderr重定向到日志文件: $ARGUMENT_LIST = "train", "--solver=cnn.prototxt" & caffe.exe "$ARGUMENT_LIST" 2> caffe.log 日志文件如下所示: caffe.exe : I0512 15:46:58.838964 1124 caffe.cpp:218

我正在使用powershell运行可执行文件(
caffe.exe
)。输出由
glog
提供,它被写入
stderr
而不是
stdout
。因此,如果我将
stderr
重定向到日志文件:

$ARGUMENT_LIST = "train", "--solver=cnn.prototxt"
& caffe.exe "$ARGUMENT_LIST" 2> caffe.log
日志文件如下所示:

caffe.exe : I0512 15:46:58.838964  1124 caffe.cpp:218] Using GPUs 0
所在位置 D:\caffe\cnn\train_cnn.ps1:13 字符: 1
+ & $BIN_PATH $ARGUMENT_LIST 2>&1 > $LOG_FILE
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (I0512 15:46:58....8] Using GPUs 0:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

I0512 15:46:59.014129  1124 caffe.cpp:223] GPU 0: GeForce GTX 1060
...
我必须手动删除这些附加行。 我试图使用
$ErrorView=“CategoryView”
,但前面至少有一行:

NotSpecified: (I0512 15:55:24....8] Using GPUs 0:String) [], RemoteException
似乎来自
stderr
的第一行已由powershell处理。 有什么办法阻止它吗