Attempt to execute SCRIPT trainNetwork as a function: C:\Program Files\Poly​space\R201​9b\toolbox​\nnet\cnn\​trainNetwo​rk.m

8 ビュー (過去 30 日間)

回答 (1 件)

Sreeram
Sreeram 2025 年 5 月 8 日
Hi Atiya,
The error message indicates that MATLAB is trying to run "trainNetwork" as a script rather than as a function. For more information on the differences between scripts and functions, please refer to the following documentation:
One possible cause of this issue is the presence of a user-defined M-file named "trainNetwork.m" that is conflicting with the built-in function. To resolve this, rename any user-defined functions that appear higher on the MATLAB path than the built-in function to prevent such conflicts.
To determine the location(s) of the "trainNetwork" function that MATLAB is referencing, run the following command in MATLAB:
which -all trainNetwork
/MATLAB/toolbox/nnet/cnn/trainNetwork.m
I hope this helps!
  1 件のコメント
Walter Roberson
Walter Roberson 2025 年 5 月 8 日

We can see from the path that was reported, that this is not a case of a third party file on the path shadowing the appropriate file.

It is possible that the appropriate file is corrupted, in which case the toolbox would need to be reinstalled.

Before reinstalling, experiment with

rehash toolboxcache

in case the cache of toolboxes has been corrupted.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by