I am trying to do the same and getting the same error. According to Khashayar Ghaffari's comment, this should work if say I have 10 input data points and 10 output data points, right? But I am sure that this condition is met and even then I am getting the error. Any further insight on this would be very appreciated. I need to run this for 1000 data sets and going through each file will be very difficult.