Matlab - 在命令行环境下运行train函数
我正在尝试使用 train
函数来训练神经网络。问题是我想使用 SSH 连接通过互联网远程执行此操作。
但是,我收到以下错误:
??? Error using ==> nntraintool at 28
NNTRAINTOOL requires Java which is not available
Error in ==> trainbr>train_network at 257
[userStop,userCancel] = nntraintool('check');`
Error in ==> trainbr at 116`
[net,tr] = train_network(net,tr,data,fcns,param);`
Error in ==> network.train at 107`
[net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);`
Error in ==> ClassifierScript at 28`
[MFLDefectSNetwork, tr] = train(MFLDefectSNetwork, TrainingInputSet,
TrainingSTargets);`
我认为我收到此错误是因为当您想要执行神经网络训练时显示的训练界面。如果是这样,您能否告诉我,如何关闭该可视界面,以便我可以使用 ssh 连接来运行它。
I am trying to train a neural network, by using the train
function. The thing is that I want to do this remotely over the internet by using a SSH connection.
However, I am receiving the following error:
??? Error using ==> nntraintool at 28
NNTRAINTOOL requires Java which is not available
Error in ==> trainbr>train_network at 257
[userStop,userCancel] = nntraintool('check');`
Error in ==> trainbr at 116`
[net,tr] = train_network(net,tr,data,fcns,param);`
Error in ==> network.train at 107`
[net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);`
Error in ==> ClassifierScript at 28`
[MFLDefectSNetwork, tr] = train(MFLDefectSNetwork, TrainingInputSet,
TrainingSTargets);`
I think I receive this error because of the training interface which is displayed when you want to perform a neural net training. If so, could you please tell me, how can I turn that visual interface off so that I can run this by using ssh connection.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我相信您可以通过设置 网络对象 设置为
false
” rel="nofollow">nntraintool
。例如,如果您的网络对象存储在变量net
中,则您需要在训练之前执行以下操作:此 MATLAB 新闻组线程 还建议您可能需要注释掉
nntraintool
,您可以在使用命令edit nntraintool
进行编辑。I believe you can solve this by setting the
trainParam.showWindow
parameter of your network object tofalse
before callingnntraintool
. For example, if your network object is stored in the variablenet
, you would do this before you train:This MATLAB Newsgroup thread also suggests that you may have to comment out some lines in
nntraintool
, which you can open in the editor with the commandedit nntraintool
.(免责声明:以下内容未经测试。我目前只能访问 Windows 安装的 MATLAB)
尝试以下命令序列来启动 MATLAB(请注意,您不应使用 -nojvm 选项):
进入 MATLAB 后,您可以明确检查 Java 是否可用:
接下来,继续创建和使用神经网络(您只需抑制 训练反馈):
作为旁注,即使我们禁用了所有显示,我们仍然可以绘制内容(尽管不可见)并将图形导出到文件,正如我在 上一页相关问题...
(Disclaimer: the following is untested. I currently only have access to a Windows installation of MATLAB)
Try the following sequence of commands to start MATLAB (note that you should NOT use the -nojvm option):
Once in MATLAB, you can explicitly check that Java is available:
Next, proceed to create and use the neural network (you just have to suppress training feedback):
As a side note, even though we disabled all display, we can still plot stuff (although invisible) and export figures to files, as I have shown in previous related questions...