尝试替换lua文件中的参数时出现问题

尝试替换lua文件中的参数时出现问题,lua,torch,Lua,Torch,我以前从未使用过lua编程,但我必须运行一个用lua语言编写的包。这个包是一个命令行linux界面,我不必知道lua编程。在这个包中,我只需要用自己的地址和数据集或文件名替换lua文件中的一些地址,就可以运行程序。但是我在运行lua文件时遇到了一个问题。在此文件中,我替换了以下代码: dofile 'Csv.lua' local proteinFile = Csv(opt.dataset..".node","r") local proteinString = proteinFile:reada

我以前从未使用过lua编程,但我必须运行一个用lua语言编写的包。这个包是一个命令行linux界面,我不必知道lua编程。在这个包中,我只需要用自己的地址和数据集或文件名替换lua文件中的一些地址,就可以运行程序。但是我在运行lua文件时遇到了一个问题。在此文件中,我替换了以下代码:

dofile 'Csv.lua'

local proteinFile = Csv(opt.dataset..".node","r")
local proteinString = proteinFile:readall()

ppFeature = {}
pNumber = {}

for i=1, #proteinString do

local fileName = opt.dataset..'/'..proteinString[i][1]

if file_exists( fileName ) then

local proFile = Csv( fileName, 'r', '\t')
local profile = proFile:readall()
关于这一点:

dofile 'Csv.lua'

local proteinFile = Csv("/storage/users/ssalmanian/DPPI/myTrain.node","r")
local proteinString = proteinFile:readall()

ppFeature = {}
pNumber = {}

for i=1, #proteinString do

local fileName = '/storage/users/ssalmanian/DPPI/myTrain/proteinString[i][1]'

if file_exists( fileName ) then

local proFile = Csv( fileName, 'r', '\t')
local profile = proFile:readall()
我犯了个错误。 运行该命令之前所需的输入文件包括一个文件和一个与-dataset名称相同的文件夹:

A) 文件的后缀为“.node”(myTrain.node)。该文件有一列,其中包含所有蛋白质的名称

B) 与-dataset(myTrain)同名的概要文件文件夹。此文件夹包含所有蛋白质的配置文件

此文件夹中的配置文件名称与“.node”文件中的蛋白质名称相同

我想知道是否有人可以让我知道它有什么问题,哪些代码必须替换为以下代码:

local fileName = opt.dataset..'/'..proteinString[i][1]
谢谢

编辑: 包是package,我尝试在CUDA服务器中使用以下命令运行create_crop.lua代码来创建两个文件myTrain_profile_crop_512.t7和myTrain_number_crop_512.t7:

th creat_crop.lua -dataset myTrain

create_crop.lua代码依赖于调用Csv.lua代码,需要myTrain.node文件和myTrain文件夹。在这里,我添加了我的WinSCP页面和我得到的错误。

在原始文件中,将每次出现的
opt.dataset
替换为
“/storage/users/ssalmanian/DPPI/myTrain”
我已替换为相同的地址,但是proteinString[I][1]呢?有什么问题吗?为什么我会出错?我应该为文件路径的这一部分使用任何占位符吗?
proteinString[I][1]
没有问题,因此本地文件名=“/storage/users/ssalmanian/DPPI/myTrain/proteinString[I][1]”是正确的吗?否。只有
opt.dataset
必须被替换。在原始文件中,用
opt.dataset
替换所有出现的
“/storage/users/ssalmanian/DPPI/myTrain”
我用相同的地址替换了它,但是proteinString[I][1]怎么办?它有什么问题吗?为什么会出错?我应该为文件路径的这一部分使用占位符吗?
proteinString[I][1]没有问题
So local fileName='/storage/users/ssalmanian/DPPI/myTrain/proteinString[i][1]是否正确?否。只有
opt.dataset
必须替换。