Closed wukongtea closed 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
)?
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);
Do you have the Neural Network Toolbox installed?
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.
Hi, can you please give a few more details of the problem? I cannot reproduce the error.
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
Can you post what the dispatchers
cell object contains?
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.
It's likely that it's not compatible with Matlab 2017b then. Would you be able to try 2018a or newer?
Yes I tried it in 2019a and it works.
Okay, thank you, I will update the instructions.
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 ?