surrogateopt: Dot indexing is not supported for variables of this type.
4 ビュー (過去 30 日間)
古いコメントを表示
I am trying to use the function surrogateopt in a script that I submit to a computer cluster. I don't want to plot the solver progress. To illustrate the problem that I have, I will use the toy code "Minimization_test.m":
minobj=@(xj)(xj+2).^2;
lbe= [-20];
ube= [20];
opts = optimoptions(@surrogateopt,'PlotFcn',[],'MaxFunctionEvaluations',600);
xj = surrogateopt(minobj,lbe,ube,[],opts)
This script works correctly on my computer (matlab 2020a) and on the cluster (matlab 2020a) if create an interactive matlab session.
However, I get an error if I request that the job scheduling program SLURM execute the script. My SLURM script reads:
#!/bin/bash
#SBATCH -t 1:00:00
#SBATCH --mem=1g
#SBATCH -J matlab
#SBATCH -o slurm.out
module load Matlab/R2020a
matlab -nojvm -nodisplay -singleCompThread -r Minimization_test
If I submit this job, I get the following error in the output file:
Dot indexing is not supported for variables of this type.
Error in globaloptim.bmo.solver
Error in globaloptim.bmo.createSolver
Error in globaloptim.bmo.BlackboxModelOptimizer (line 92)
self =
globaloptim.bmo.createSolver(self,expensive,lb,ub,intcon,options);
Error in surrogateopt>createController (line 329)
controller =
globaloptim.bmo.BlackboxModelOptimizer(expensive,lb,ub,intcon,options);
Error in surrogateopt (line 292)
controller = createController(objconstr,lb,ub,intcon,options);
Error in Minimization_test (line 5)
xj = surrogateopt(minobj,lbe,ube,[],opts)
9 件のコメント
Farhad Omidvar
2020 年 9 月 22 日
Thanks, Walter, for the suggestions.
Before seeing them, I submitted the job for running on MATLAB/2020a (insteaad of the 2018b version) and the problem magically got fixed.
採用された回答
Walter Roberson
2020 年 9 月 22 日
Removing the -nojvm solves the problem (for reasons currently unknown.)
1 件のコメント
Daniel Rischawy
2020 年 10 月 27 日
Unfortunately I have the same problem. But I get the error if I run surrogates with parallel computing normally in Matlab2019a. The error appears random after around 200-300 iterations. Sample tasks for surrogates, however, did not cause any problems. Therefore I think it should have something to do with my objective function or parallel computing, but I do not understand the cause and why the error occurs so randomly. Could the reason be the Java version I use or the Matlab version? Thanks a lot in advance.
Regards
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Cluster Configuration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!