lanha / DSen2

Super-Resolution of Sentinel-2 Images: Learning a Globally Applicable Deep Neural Network
GNU General Public License v3.0
235 stars 71 forks source link

Matlab Demo Error #8

Closed wukongtea closed 5 years ago

wukongtea commented 5 years ago

Hi,there are some problems with matlab 2017b demo codes. DAGNetwork>iCreateDataDispatcher (line 651) For an image input layer, the input data for predict must be a single image, a 4D array of images, or an imageDatastore with the correct size. DAGNetwork>iCreateDataDispatchersForEachInputLayer (line 642) dispatchers = { iCreateDataDispatcher(X, miniBatchSize, precision) }; DAGNetwork/predict (line 389) dispatchers = iCreateDataDispatchersForEachInputLayer(X, miniBatchSize, precision); DSen2 (line 44) pred = predict(net20, q_image/2000)*2000; demoDSen2 (line 26) SR20 = DSen2(im10, im20); Can you help me ?

lanha commented 5 years ago

Hi, are you sure that the variable q_image is a 4D array of size (patch_size x patch_size x bands x nr_of_patches)?

wukongtea commented 5 years ago

Thank you for your attention.Yes, q_image is a 4D array of size . All codes are default, but it doesn't work in my computer.

K>> [a b c d]=size(q_image); K>> data = q_image(:,:,10,1);

data data2

lanha commented 5 years ago

Do you have the Neural Network Toolbox installed?

faroo014 commented 5 years ago

Hi, I am having the same issue.

size(q_image) ans = 80 80 10 100

I do have Neural Network Toolbox installed and I am using Matlab 2017b.

Will appreciate any help.

lanha commented 5 years ago

Hi, can you please give a few more details of the problem? I cannot reproduce the error.

faroo014 commented 5 years ago

In matlab_demo folder, when demoDSen2.m is run, it throws following error:

demoDSen2 Siberia Error using DAGNetwork>iCreateDataDispatcher (line 651) For an image input layer, the input data for predict must be a single image, a 4D array of images, or an imageDatastore with the correct size.

Error in DAGNetwork>iCreateDataDispatchersForEachInputLayer (line 642) dispatchers = { iCreateDataDispatcher(X, miniBatchSize, precision) };

Error in DAGNetwork/predict (line 389) dispatchers = iCreateDataDispatchersForEachInputLayer(X, miniBatchSize, precision);

Error in DSen2 (line 44) pred = predict(net20, q_image/2000)*2000;

Error in demoDSen2 (line 26) SR20 = DSen2(im10, im20);

I am using Matlab 2017b with Neural Network Toolbox installed

lanha commented 5 years ago

Can you post what the dispatchers cell object contains?

faroo014 commented 5 years ago

The code fails to generate dispatchers object. 'dispatchers' is the output of 'iCreateDataDispatchersForEachInputLayer(X, miniBatchSize, precision)' function in DAGNetwork.m (line 632) In this case, 'X' is not a cell and is of size 80x80x10x100, miniBatchSize is 128 and precision type is 'single'. When these arguments are passed to the function 'iCreateDataDispatchers' (line 646 of DAGNetwork.m) it throws above mentioned error.

lanha commented 5 years ago

It's likely that it's not compatible with Matlab 2017b then. Would you be able to try 2018a or newer?

faroo014 commented 5 years ago

Yes I tried it in 2019a and it works.

lanha commented 5 years ago

Okay, thank you, I will update the instructions.