thirdwing commented on issue #7336: io.cc:54: Data and label shape in-consistent URL: https://github.com/apache/incubator-mxnet/issues/7336#issuecomment-320472863 Are you using the prebuilt pkg? On my Linux machine with the latest code, it works well ```r library(readr) DataNeurona <- read_csv("MyData2.csv") DataNeurona <- as.matrix(DataNeurona) train.ind <- c(1:100) train.x <- DataNeurona[train.ind, -length(DataNeurona[1, ])] train.y <- DataNeurona[train.ind, length(DataNeurona[1, ])] test.x <- DataNeurona[-train.ind, length(DataNeurona[1, ])] test.y <- DataNeurona[-train.ind, length(DataNeurona[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 = 1) 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 ) ``` ``` Start training with 1 devices [1] Train-mse=0.189338970604364 [2] Train-mse=0.182918034135271 [3] Train-mse=0.139369296805449 [4] Train-mse=0.0981672365474814 [5] Train-mse=0.090259424948582 [6] Train-mse=0.091202815317992 [7] Train-mse=0.0735728471551251 [8] Train-mse=0.0755325079735637 [9] Train-mse=0.0776457090260113 [10] Train-mse=0.0703273524582357 [11] Train-mse=0.0727759200215761 [12] Train-mse=0.073669241397235 [13] Train-mse=0.0705466593146721 [14] Train-mse=0.0721189324018792 [15] Train-mse=0.0723587683907677 [16] Train-mse=0.0710235608978592 [17] Train-mse=0.0718809927804486 [18] Train-mse=0.0718809992951069 [19] Train-mse=0.0713206787760761 [20] Train-mse=0.0717545830533599 [21] Train-mse=0.071694452664629 [22] Train-mse=0.0714664637380885 [23] Train-mse=0.0716749304881256 [24] Train-mse=0.0716162021040038 [25] Train-mse=0.0715267213384503 Warning message: In mx.model.select.layout.train(X, y) : Auto detect layout of input matrix, use rowmajor.. ``` ---------------------------------------------------------------- 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