Error using the classify() function with a 3D implementation of ResNet50
3 views (last 30 days)
Show older comments
Matthew Gil
on 22 Mar 2023
Answered: Vinayak Choyyan
on 12 Apr 2023
I have successfully trained a classification network which is a 3D version of ResNet50 on images of size 314x414x100 using the trainNetwork() function. There werre no errors in the training and standard training and validation plots were produced during training. For testing the network I tried to use the classify() function which produced the following error:
Error using nnet.internal.cnn.layer.GraphExecutor/propagate
Layer 'add_3': Invalid input data. Only the first two dimensions can have a stride of more than 1.
Here the 'add_3' layer refers to the 3rd addition layer in ResNet50 and the stride value for most of the network layers is [2 2 2]. I have also attempted to use the predict() and activations() functions as a workaround but these produce the same error. I do not want to reduce the stride in the z-axis as this will lead to memory issues.
Could anyone help find a fix for this or identify a workaround?
0 Comments
Accepted Answer
Vinayak Choyyan
on 12 Apr 2023
Hi Matthew,
As per my understanding, you are facing an issue when using functions like ‘classify()’, ‘predict()’ and ‘activations()’ and getting an error saying ‘Error using nnet.internal.cnn.layer.GraphExecutor/propagate’
This is a know issue and has been fixed in MATLAB R2023a. As a workaround, please try using a ‘gpuArray’ as input. Please check out the following documentation to know more about ‘gpuArray’ https://www.mathworks.com/help/parallel-computing/gpuarray.html.
Alternatively, please consider upgrading to MATLAB R2023a if you do not wish to make changes to your workflow.
I hope this resolves the issue you are facing.
0 Comments
More Answers (0)
See Also
Categories
Find more on Image Data Workflows in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!