Output processing function REMOVECONSTANTROWS is not supported with GPU.

조회 수: 39 (최근 30일)
Hello,
I am following MATLAB tutorial on neural networks with GPU parallelization and I am not able to use my own data to start the training process, only the example data set works. The code is this:
%[xa,ta] = house_dataset;
[X_Train,Y_Train,T_Train] = loadData({'Data2008.mat'}, 0);
% Year to be predicted
[X_PredYear,Y_PredYear,T_PredYear] = loadData('Data2009.mat', 0);
xg = nndata2gpu(X_Train);
tg = nndata2gpu(Y_Train);
net1 = feedforwardnet(10);
net2 = configure(net1,X_Train,Y_Train); % Configure with MATLAB arrays
net2 = train(net2,xg,tg); % Execute on GPU with NNET formatted gpuArrays
yg = net2(xg); % Execute on GPU
y = gpu2nndata(yg); % Transfer array to local workspace
When I use the house data_set, everything works fine. However, when I load my data from the .mat file (X_Train and Y_Train are columns extracted from a table, so they are basically 2D arrays), I get the error "Output processing function REMOVECONSTANTROWS is not supported with GPU." in the line:
net2 = train(net2,xg,tg);
As if this extra functionality "REMOVECONSTANTROWS" was added to the arrays for some reason. I actually tried a "dumb" approach to copy each element from X_Train and Y_Train to double arrays and pass in the5se arrays to the function nndata2gpu but the error persists. Could anyone tell what is preventing me to use my input data in this code?
Thank you.

채택된 답변

Amanjit Dulai
Amanjit Dulai 2016년 4월 25일
The error message you are getting suggests that there are rows in your output data which are constant. Without knowing what your data is, it's hard to know for sure, but here are a few suggestions:
1) You mentioned that X_Train and Y_Train are columns from a table. Remember, the 'train' function in the Neural Network Toolbox requires that your data is formatted so that each column is an example (e.g. X_Train should be a matrix where the number of columns is the number of training samples, and the number of rows is the size of each training sample). The same applies to Y_Train. From the error, I would guess that the format for Y_Train is wrong.
2) You could switch off the output function 'removeconstantrows', although your network might encounter issues when training if some of the output data rows are constant. You can remove the output function 'removeconstantrows' with the following command:
net.output.processFcns = {'mapminmax'};
  댓글 수: 3
Lindsay Wong
Lindsay Wong 2020년 1월 22일
Thanks. I meet the same error and found that the output column is constant. Problem solved.
Yunyu Hu
Yunyu Hu 2020년 3월 1일
I also had this problem and remove the constant input columns , then problem solved

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Remington Reid
Remington Reid 2019년 9월 10일
I ran into the same issue but required a slightly different solution. I was training a 2 layer feedforward net that produces a single output. The input training data dimensions were 6 x N and the output training dimensions were 1 x N. The output data was definitely not constant. I tried filtering repeated values in the output to be safe with no luck. Both input and output were classed as 'double'. Disabling the REMOVECONSTANTROWS option worked but I had to disable it both on the input and on the output.
net.input.processFcns = {'mapminmax'};
net.output.processFcns = {'mapminmax'};
In my case network training and performance did not seem to suffer, but since there were no constant rows I suppose that isn't to surprising. Thank you for the instructions to disable the option!

카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by