HXZ886
HXZ886
2018-12-13 10:46

python调用matlab的问题

  • matlab
  • python

在matlab运行函数时没有问题,但是用python调用该matlab函数时,出现报错如下。求问有遇到这种情况的吗?

import matlab.engine
engine = matlab.engine.start_matlab() # Start MATLAB process
engine.vl_compilenn
label=engine.experi('/13/10.wav')
print(label)
Attempt to execute SCRIPT vl_nnconv as a function:
/usr/local/MATLAB/R2017b/toolbox/MatConvNet/matconvnet-1.0-beta25/matlab/vl_nnconv.m

Error in dagnn.Conv/forward (line 12)
      outputs{1} = vl_nnconv(...

Error in dagnn.Layer/forwardAdvanced (line 85)
      outputs = obj.forward(inputs, {net.params(par).value}) ;

Error in dagnn.DagNN/eval (line 91)
  obj.layers(l).block.forwardAdvanced(obj.layers(l)) ;

Error in experi (line 68)
      dag.eval({'data', gpuArray(inp1)}) ;

Traceback (most recent call last):
  File "/home/affcgroup/affc/Ser/affccompute/mcnCrossModalEmotions-master/emoVoxCeleb/p3.py", line 4, in <module>
    label=engine.experi('/home/affcgroup/mustudy/data/lianke/13/10.wav')
  File "/usr/local/lib/python2.7/dist-packages/matlab/engine/matlabengine.py", line 78, in __call__
    _stderr, feval=True).result()
  File "/usr/local/lib/python2.7/dist-packages/matlab/engine/futureresult.py", line 68, in result
    return self.__future.result(timeout)
  File "/usr/local/lib/python2.7/dist-packages/matlab/engine/fevalfuture.py", line 82, in result
    self._result = pythonengine.getFEvalResult(self._future,self._nargout, None, out=self._out, err=self._err)
matlab.engine.MatlabExecutionError: 
  File /home/affcgroup/MatConvNet/matconvnet-1.0-beta25/matlab/+dagnn/Conv.m, line 12, in Conv.forward

  File /home/affcgroup/MatConvNet/matconvnet-1.0-beta25/matlab/+dagnn/Layer.m, line 85, in Layer.forwardAdvanced

  File /usr/local/MATLAB/R2017b/toolbox/MatConvNet/matconvnet-1.0-beta25/matlab/+dagnn/@DagNN/eval.m, line 91, in eval

  File /home/affcgroup/affc/Ser/affccompute/mcnCrossModalEmotions-master/emoVoxCeleb/experi.m, line 68, in experi
Attempt to execute SCRIPT vl_nnconv as a function:
/usr/local/MATLAB/R2017b/toolbox/MatConvNet/matconvnet-1.0-beta25/matlab/vl_nnconv.m

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答