dma100180 commented on issue #7336: io.cc:54: Data and label shape in-consistent
URL: 
https://github.com/apache/incubator-mxnet/issues/7336#issuecomment-320522494
 
 
   Hi, yes, it works like this with an output field, but when they are 2 or 
more, I change the fc4 layer with 2 neurons and train.y with two fields and it 
gives me the error: 
   
   Error in mx.io.internal.arrayiter(as.array(data), as.array(label), 
unif.rnds,  : 
     io.cc:54: Data and label shape in-consistent
   
   
   I put all the code that you had but with the changes in train.x train.y and 
fc4
   
   Thanks for everything
   
   
   library(readr)
   DataNeurona <- read_csv("D:/DATOS_PROYECTO/MyData2.csv")
   DataNeurona <- as.matrix(DataNeurona)
   
   train.ind <- c(1:100)
   
train.x<-DataNeurona[train.ind,-c(length(DataNeurona[1,]),length(DataNeurona[1,])-1)]
   
train.y<-DataNeurona[train.ind,c(length(DataNeurona[1,]),length(DataNeurona[1,])-1)]
   test.x <- DataNeurona[-train.ind, 
-c(length(DataNeurona[1,]),length(DataNeurona[1,])-1)]
   test.y <- DataNeurona[-train.ind, 
c(length(DataNeurona[1,]),length(DataNeurona[1,])-1)]
   
   library(mxnet)
   
   data <- mx.symbol.Variable("data")
   fc1 <-  mx.symbol.FullyConnected(data, name = "fc1", num_hidden = 40) 
#weight=w,
   act1 <- mx.symbol.Activation(fc1, name = "sigmoid1", act_type = "sigmoid")
   fc2 <- mx.symbol.FullyConnected(act1, name = "fc2", num_hidden = 50)
   act2 <- mx.symbol.Activation(fc2, name = "tanh1", act_type = "sigmoid")
   fc4 <- mx.symbol.FullyConnected(act2, name = "fc4", num_hidden = 2)
   lro <- mx.symbol.LinearRegressionOutput(data = fc4, grad.scale = 1)
   mx.set.seed(0)
   
   model <- mx.model.FeedForward.create(
     symbol = lro,
     X = train.x,
     y = train.y,
     ctx = mx.cpu(),
     num.round = 25,
     array.batch.size = 20,
     learning.rate = 0.05,
     momentum = 0.9,
     eval.metric = mx.metric.mse
   )
   
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to