You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's difficult to assess what package is causing the issue, but i'm going to raise it here as this issue only happens when matlab.engine is imported.
Bug description
importing matlab.engine breaks pytorch_lightning ability to load a previously saved model.
This only happens when import matlab.engine is included in the script. The checkpoint_path is not empty.
How to reproduce the bug
importmatlab.enginefrommy_custom_modelimportLITModel# this is a pytorch_lightning.LightningModule modelchkpoint_path='/path/to/my/checkpoint.ckpt'model=LITModel.load_from_checkpoint(checkpoint_path=chkpoint_path)
Important
If the import of matlab.engine comes after the LITModel import, then the code does not error.
Error messages and logs
LITModel.load_from_checkpoint(chkpoint_path)
File "/home/anaconda3/envs/torch/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 139, in load_from_checkpoint
checkpoint = pl_load(checkpoint_path, map_location=lambda storage, loc: storage)
File "/home/anaconda3/envs/torch/lib/python3.8/site-packages/pytorch_lightning/utilities/cloud_io.py", line 47, in load
return torch.load(f, map_location=map_location)
File "/home/anaconda3/envs/torch/lib/python3.8/site-packages/torch/serialization.py", line 705, in load
with _open_zipfile_reader(opened_file) as opened_zipfile:
File "/home/anaconda3/envs/torch/lib/python3.8/site-packages/torch/serialization.py", line 243, in __init__
super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: [enforce fail at inline_container.cc:106] . archive does not contain any files
I've narrowed down the issue to the pythonengine.createProcess() function call within matlab.engine.enginesession.EngineSession. Commenting out these will stop the issue.
pythonengine is instantiated from a shared object file (on my system) located at /usr/local/MATLAB/R2022b/extern/engines/python/dist/matlab/engine/glnxa64/matlabengineforpython3_8.so.
As far as I know, the code to build matlabengineforpython3_8.so is proprietary, and so this is as far as I can inspect.
It's difficult to assess what package is causing the issue, but i'm going to raise it here as this issue only happens when
matlab.engine
is imported.Bug description
importing
matlab.engine
breakspytorch_lightning
ability to load a previously saved model.This only happens when
import matlab.engine
is included in the script. Thecheckpoint_path
is not empty.How to reproduce the bug
Important
matlab.engine
comes after theLITModel
import, then the code does not error.Error messages and logs
Environment
The text was updated successfully, but these errors were encountered: