importing matlab.engine breaks pytorch-lightning model loading.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- machine-learning
Direzione di ricerca
Start with the minimal reproduction using matlab.engine before the LITModel import and inspect pytorch_lightning/core/saving.py, utilities/cloud_io.py, and torch/serialization.py at the traceback locations. Compare behavior with the imports reversed and verify the reported Python, PyTorch, PyTorch Lightning, MATLAB Engine, and Ubuntu versions. Done means the checkpoint loads successfully regardless of import order, or the compatibility limitation is clearly documented.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
import matlab.engine
from my_custom_model import LITModel # this is a pytorch_lightning.LightningModule model
chkpoint_path = '/path/to/my/checkpoint.ckpt'
model = LITModel.load_from_checkpoint(checkpoint_path=chkpoint_path)
Important
- If the import of
matlab.enginecomes after theLITModelimport, 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
Environment
- Linux: Ubuntu 22.04.1 LTS
- python==3.8.12
- pytorch_lightning==1.6.4
- torch==1.11.0
- matlabengine==9.13.1
- Matlab: R2022b
- Lingua principale
- Python
- Stelle
- 97
- Fork
- 13
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mathworks/matlab-engine-for-python
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
-
Support sparse arrayAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Failed to build matlabengineAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
Tutte le issue di mathworks/matlab-engine-for-python
Issue simili
-
ACK_WAITING HELP_WANTED UPDATE_CS
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
OWASP/CheatSheetSeries#2458 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
BasedHardware/omi#19711 ·
I maintainer di solito rispondono entro 1 giorno
-
Qwen3_5MoeModel no longer returns router_logits, breaking aux loss with output_router_logits=TrueAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
huggingface/transformers#49172 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
vllm-project/vllm-metal#885 ·
I maintainer di solito rispondono entro 1 giorno