I want to create some neural network in tensorflow 2.x that trains on a GPU and I want to set up all the necessary infrastructure inside a docker-compose network (assuming that this is actually possible for now). As far as I know, in order to train a tensorflow model on a GPU, I need the CUDA toolkit and the NVIDIA driver. To install these dependencies natively on my computer (OS: Ubuntu 18.04) is always quite a pain, as there are …
这个问题与理解有关 DockerOperator 和 Apache Airflow 的概念有关,所以我不确定这个站点是否正确。如果没有,请告诉我可以在哪里发布。
情况如下:我正在使用 Windows 笔记本电脑,我开发了一个非常基本的 ETL 管道,它从某个服务器中提取数据,并使用 Apache-Airflow 按计划将未处理的数据写入 MongoDB。我有一个docker-compose.yml包含三个服务的文件:MongoDB 的 mongo 服务、作为 MongoDB 管理工具的 mongo-express 服务、Apache-Airflow 的网络服务器服务和作为 Apache-Airflow 数据库后端的 postgres 服务。
到目前为止,我已经在函数中开发了一些 Python 代码,这些函数正在被 Airflow 实例使用 PythonOperator 调用。由于使用 PythonOperator 进行调试非常困难,因此我现在想尝试使用 DockerOperator。我一直在关注本教程,该教程声称使用 DockerOperator,您可以独立于操作系统开发源代码,由于 Docker 的概念“一次构建,随处运行”,代码稍后将在其上执行。
我的问题是我没有完全理解使用 DockerOperator 运行代码所需的所有必要步骤。在教程中,我有以下关于任务开发和部署的问题:
感谢您的时间,我非常感谢!
我想创建一个循环访问大量文件的函数,计算每个文件的完整案例数,然后将新行附加到具有文件“ ID”编号及其对应完整数量的现有数据帧中案件。
在下面,我创建了一个仅返回数据帧最后一行的代码。我相信我的函数只会返回最后一行,因为R在每个循环中都会覆盖我的数据帧,但是我不确定。我在网上做了很多研究如何解决这个问题,但是我找不到一个简单的解决方案(我对R非常陌生)。
在下面,您可以看到我的代码和得到的输出:
complete <- function(directory = "specdata", id = 1:332) {
files_list <- list.files("specdata", full.names = T) # creates a list of files
dat <- data.frame() # creates an emmpty data frame
for (i in id) {
data <- read.csv(files_list[i]) # reads the file "i" in the id vector
nobs <- sum(complete.cases(data)) # counts the number of complete cases in that file
data_frame <- data.frame("ID" = i, nobs) # here I want to store the number of complete …Run Code Online (Sandbox Code Playgroud)