I tried converting a MATLAB model to PyTorch using ONNX, like proposed here by Andrew Naguib:
How to import deep learning models from MATLAB to PyTorch?
I tried running the model using the following code:
import onnx
from onnx2pytorch import ConvertModel
import torch
onnx_model = onnx.load ('resnet50.onnx')
pytorch_model = ConvertModel(onnx_model)
model = torch.load(pytorch_model)
But I got this error:
AttributeError: 'ConvertModel' object has no attribute 'seek'. You can only torch.load from a file that is seekable. Please pre-load the data into a buffer like io.BytesIO and try to load from it instead.
How can I fix it, please? Any ideas on how can I "pre-load the data into a buffer like io.BytesIO"?