-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
Hi, there, this installation doc needs to be updated, it still recommend python/3.7 and python/3.8: https://docs.scarches.org/en/latest/installation.html.
And even installation with python/3.9 will fail on the sca.models.SCVI.load_query_data step of https://github.com/theislab/scarches/blob/master/notebooks/scvi_surgery_pipeline.ipynb:
>>> model = sca.models.SCVI.load_query_data(
... target_adata,
... ref_path,
... freeze_dropout = True,
... )
INFO File ref_model/model.pt already downloaded
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/conda/envs/scarches/lib/python3.9/site-packages/scvi/model/base/_archesmixin.py", line 86, in load_query_data
attr_dict, var_names, load_state_dict = _get_loaded_data(reference_model, device=device)
File "/conda/envs/scarches/lib/python3.9/site-packages/scvi/model/base/_archesmixin.py", line 323, in _get_loaded_data
attr_dict, var_names, load_state_dict, _ = _load_saved_files(
File "/conda/envs/scarches/lib/python3.9/site-packages/scvi/model/base/_utils.py", line 66, in _load_saved_files
model = torch.load(model_path, map_location=map_location)
File "/conda/envs/scarches/lib/python3.9/site-packages/torch/serialization.py", line 1529, in load
raise pickle.UnpicklingError(_get_wo_message(str(e))) from None
_pickle.UnpicklingError: Weights only load failed. This file can still be loaded, to do so you have two options, do those steps only if you trust the source of the checkpoint.
(1) In PyTorch 2.6, we changed the default value of the `weights_only` argument in `torch.load` from `False` to `True`. Re-running `torch.load` with `weights_only` set to `False` will likely succeed, but it can result in arbitrary code execution. Do it only if you got the file from a trusted source.
(2) Alternatively, to load with `weights_only=True` please check the recommended steps in the following error message.
WeightsUnpickler error: Unsupported global: GLOBAL numpy.core.multiarray._reconstruct was not an allowed global by default. Please use `torch.serialization.add_safe_globals([numpy.core.multiarray._reconstruct])` or the `torch.serialization.safe_globals([numpy.core.multiarray._reconstruct])` context manager to allowlist this global if you trust this class/function.
We track down the error is due to that the highest scvitools could be installed on python/3.9 is 1.1.6.post2, so
python/3.10 is required for scvi-tools/1.3.3 or any version >1.1.6.post2 to avoid the upper error.
This is our installation version as a reference:
mamba create -n scarches python=3.10
mamba activate scarches
mamba install uv
uv pip install scArches==0.6.1
# there was some compatible issue with numpy/2
uv pip install numpy==1.26.4
ssun1116, arashabadi, ZhangHaibo-777 and ayaazuddin
Metadata
Metadata
Assignees
Labels
No labels