在 azure-ml 中调试 R 脚本:在哪里可以找到 stdout 和 stderr 日志? (或者为什么它们是空的?)
Debugging R Scripts in azure-ml: Where can stdout and stderr logs be found? (or why are they empty?)
我正在使用 Microsoft Azure 机器学习中的 "studio (preview)" 创建一个管道,将机器学习应用于连接到我们的数据仓库的 blob 存储中的数据集。
在 "Designer" 中,可以将 "Exectue R Script" 操作添加到管道中。我正在使用此功能来执行我自己的一些机器学习算法。
我有这个脚本的 'hello world' 版本(包括使用 "script bundle" 加载我自己的 R 文件中的函数)。它应用了一个非常简单的操作(计算与日期列中的日期和 'today' 的天差),并将输出存储为一个新文件。鉴于导出的文件具有正确的信息,我知道 R 脚本运行良好。
脚本如下所示:
# R version: 3.5.1
# The script MUST contain a function named azureml_main
# which is the entry point for this module.
# The entry point function can contain up to two input arguments:
# Param<medals>: a R DataFrame
# Param<matches>: a R DataFrame
azureml_main <- function(dataframe1, dataframe2){
message("STARTING R script run.")
# If a zip file is connected to the third input port, it is
# unzipped under "./Script Bundle". This directory is added
# to sys.path.
message('Adding functions as source...')
if (FALSE) {
# This works...
source("./Script Bundle/first_function_for_script_bundle.R")
} else {
# And this works as well!
message('Sourcing all available functions...')
functions_folder = './Script Bundle'
list.files(path = functions_folder)
list_of_R_functions <- list.files(path = functions_folder, pattern = "^.*[Rr]$", include.dirs = FALSE, full.names = TRUE)
for (fun in list_of_R_functions) {
message(sprintf('Sourcing <%s>...', fun))
source(fun)
}
}
message('Executing R pipeline...')
dataframe1 = calculate_days_difference(dataframe = dataframe1)
# Return datasets as a Named List
return(list(dataset1=dataframe1, dataset2=dataframe2))
}
虽然我确实在 R 脚本中打印了一些消息,但我一直无法找到应该包含这些打印消息的 "stdoutlogs" 和 "stderrlogs"。
我需要打印消息 1) 有关分析如何进行的信息以及 - 最重要的 - 2) 调试以防代码失败。
现在,我(在多个位置)找到了文件 "stdoutlogs.txt" 和 "stderrlogs.txt"。当我点击 "Designer" 中的 "Exectue R Script" 时,这些可以在 "Logs" 下找到。
我还可以在 "Experiments" 下找到 "stdoutlogs.txt" 和 "stderrlogs.txt" 文件,当我单击完成的 "Run" 然后在选项卡 "Outputs" 和选项卡 [= 下35=]。
但是...所有这些文件都是空的。
谁能告诉我如何从我的 R 脚本打印消息并帮助我找到打印信息的位置?
能否请您点击 "Execute R module" 并下载 70_driver.log?我在 R 示例中尝试了 message("STARTING R script run.") 并且可以在那里找到输出。
我正在使用 Microsoft Azure 机器学习中的 "studio (preview)" 创建一个管道,将机器学习应用于连接到我们的数据仓库的 blob 存储中的数据集。
在 "Designer" 中,可以将 "Exectue R Script" 操作添加到管道中。我正在使用此功能来执行我自己的一些机器学习算法。
我有这个脚本的 'hello world' 版本(包括使用 "script bundle" 加载我自己的 R 文件中的函数)。它应用了一个非常简单的操作(计算与日期列中的日期和 'today' 的天差),并将输出存储为一个新文件。鉴于导出的文件具有正确的信息,我知道 R 脚本运行良好。
脚本如下所示:
# R version: 3.5.1
# The script MUST contain a function named azureml_main
# which is the entry point for this module.
# The entry point function can contain up to two input arguments:
# Param<medals>: a R DataFrame
# Param<matches>: a R DataFrame
azureml_main <- function(dataframe1, dataframe2){
message("STARTING R script run.")
# If a zip file is connected to the third input port, it is
# unzipped under "./Script Bundle". This directory is added
# to sys.path.
message('Adding functions as source...')
if (FALSE) {
# This works...
source("./Script Bundle/first_function_for_script_bundle.R")
} else {
# And this works as well!
message('Sourcing all available functions...')
functions_folder = './Script Bundle'
list.files(path = functions_folder)
list_of_R_functions <- list.files(path = functions_folder, pattern = "^.*[Rr]$", include.dirs = FALSE, full.names = TRUE)
for (fun in list_of_R_functions) {
message(sprintf('Sourcing <%s>...', fun))
source(fun)
}
}
message('Executing R pipeline...')
dataframe1 = calculate_days_difference(dataframe = dataframe1)
# Return datasets as a Named List
return(list(dataset1=dataframe1, dataset2=dataframe2))
}
虽然我确实在 R 脚本中打印了一些消息,但我一直无法找到应该包含这些打印消息的 "stdoutlogs" 和 "stderrlogs"。
我需要打印消息 1) 有关分析如何进行的信息以及 - 最重要的 - 2) 调试以防代码失败。
现在,我(在多个位置)找到了文件 "stdoutlogs.txt" 和 "stderrlogs.txt"。当我点击 "Designer" 中的 "Exectue R Script" 时,这些可以在 "Logs" 下找到。 我还可以在 "Experiments" 下找到 "stdoutlogs.txt" 和 "stderrlogs.txt" 文件,当我单击完成的 "Run" 然后在选项卡 "Outputs" 和选项卡 [= 下35=]。 但是...所有这些文件都是空的。
谁能告诉我如何从我的 R 脚本打印消息并帮助我找到打印信息的位置?
能否请您点击 "Execute R module" 并下载 70_driver.log?我在 R 示例中尝试了 message("STARTING R script run.") 并且可以在那里找到输出。