Undefined function 'isvalid' for input arguments of type 'double'.

10 visualizzazioni (ultimi 30 giorni)
I have a problem in running a matlab code which optimizes the hyperparameter of GPR on a cluster. The code can run without warning or error on my local computer, but the error occurs when I run it on a cluster.
The code for the GPR is as follows:
regressionGP = fitrgp(...
predictors, ...
response, ...
'BasisFunction', 'constant', ...
'KernelFunction', 'matern52', ...
'OptimizeHyperparameters','auto',...
'Standardize', true);
When I run it on a cluster with "matlab -nojvm -nodisplay -nosplash < GPR_hyperopt.m", I have the following error:
|======================================================================================|
| Iter | Eval | Objective: | Objective | BestSoFar | BestSoFar | Sigma |
| | result | log(1+loss) | runtime | (observed) | (estim.) | |
|======================================================================================|
| 1 | Best | 0.044266 | 1.3047 | 0.044266 | 0.044266 | 4.2216 |
The error message follows:
Input #2 expected to be a cell array, was double instead.
The error message follows:
Undefined function 'isvalid' for input arguments of type 'double'.
| 2 | Best | 0.01721 | 0.40794 | 0.01721 | 0.018889 | 0.012817 |
The error message follows:
Input #2 expected to be a cell array, was double instead.
The error message follows:
Undefined function 'isvalid' for input arguments of type 'double'.
I am using matlab R2019b on both my local machine and the cluster.
Could anyone help on this problem? Any suggestion is really appreciated! Thanks a lot!!!!

Risposte (1)

Shivam Lahoti
Shivam Lahoti il 6 Mar 2025
Hi hlslxy,
The issue you're facing could be due to missing dependencies or toolboxes that are not installed on the cluster environment. Although your code runs successfully on your local machine, the cluster setup might differ, and specific toolboxes required for your code, such as the Statistics and Machine Learning Toolbox, might not be available.
To resolve this issue, first ensure that all necessary toolboxes are installed on the cluster. Since you're working with Gaussian Process Regression, the Statistics and Machine Learning Toolbox is essential. You can verify which toolboxes are available by using the 'ver' command in the MATLAB command line on the cluster. Additionally, check that the paths to any custom functions or files you are using are correctly set on the cluster.
If the cluster is running MATLAB without the Java Virtual Machine (JVM) using the '-nojvm' option, consider whether this might affect your code's execution. Some functions might require JVM for certain operations. If possible, try running your code without the '-nojvm' option to see if this resolves the issue.
I hope this was helpful!

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by