Why does "predict" result in an error when setting the parameter "ExecutionEnvironment" in Deep Learning Toolbox?
9 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2024 年 10 月 16 日
編集済み: MathWorks Support Team
2024 年 10 月 28 日
I encountered an error when trying to perform inference with the help of GPU using a "dlnetwork" object.
I have a "dlnetwork" that I use with the "predict" function. It works as expected when I use the "predict" function alone:
>> allQval=predict(net,stateValue);
But specifying a value for "ExecutionEnvironment" explicitly triggers the error:
>> allQval=predict(net,stateValue,"ExecutionEnvironment","parallel");Error using dlnetwork/validateForwardInputs
Incorrect number of network inputs. Network has 1 inputs, but 3 inputs were passed. To determine number and order of inputs, check
network 'InputNames' property.
How can I use my GPU with the "predict" function?
採用された回答
MathWorks Support Team
2024 年 10 月 28 日
編集済み: MathWorks Support Team
2024 年 10 月 28 日
"ExecutionEnvironment" is not a valid input argument for the "dlnetwork" "predict" function.
To use a GPU with the "predict" function, you can pass the input as "GPUArrays".
See the "GPU Arrays" section of the documentation page: https://uk.mathworks.com/help/releases/R2024b/deeplearning/ref/dlnetwork.predict.html#refsect-extended-capabilities
Alternatively, for batched-predictions, use the function "minibatchpredict" from R2024a. This uses the GPU through the "ExecutionEnvironment" argument.
Please note, the "Acceleration" input for "predict" is not the same as the "ExecutionEnvironment". "Acceleration"="mex" compiles and executes a "mex" function for inference using GPU Coder. For more information, please see the documentation: https://uk.mathworks.com/help/releases/R2024b/deeplearning/ref/dlnetwork.predict.html#mw_55eba9d5-3e06-467e-a6cd-e1cffe0569fd
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!