Error in example slexPyTorchPredictExample
古いコメントを表示
Error due to multiple causes.
Caused by:
Error using PredictResponsesPyTorchModelPredictBlockExample (line 6)
MATLAB System block 'slexPyTorchPredictExample/PyTorch Model Predict/PyTorch Model Block' error occurred when invoking 'getOutputSizeImpl' method of 'nnet.pycoexblks.PyTorchModelBlock'. The error was thrown from '
'C:\Program Files\Matlab\R2025b\toolbox\nnet\pycoexblks\+nnet\+pycoexblks\PyTorchModelBlock.m' at line 47
'C:\Program Files\Matlab\R2025b\toolbox\shared\pycoexblks\+internal\+pycoexblks\PythonModelBlockBase.p' at line 0
'C:\Program Files\Matlab\R2025b\toolbox\shared\pycoexblks\+internal\+pycoexblks\PythonModelBlockBase.p' at line 0
'C:\Users\<username>\Documents\MATLAB\Examples\R2025b\deeplearning_shared\PredictResponsesPyTorchModelPredictBlockExample\PredictResponsesPyTorchModelPredictBlockExample.mlx' at line 6'.
Error using PredictResponsesPyTorchModelPredictBlockExample (line 6)
Unable to load specified PyTorch model file 'ptmodel.pth' in Python. The PyTorch model file must be valid, and the PyTorch model class must be on the Python path. The Python error message is: 'The Python model could not be loaded. The Python error message was: 'Python Error: ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject'.'.
Error using PredictResponsesPyTorchModelPredictBlockExample (line 6)
Error in port widths or dimensions. 'Output Port 1' of 'slexPyTorchPredictExample/PyTorch Model Predict/In1' is a one dimensional vector with 34 elements.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Call Python from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!