angelolab / ark-analysis

Integrated pipeline for multiplexed image analysis
https://ark-analysis.readthedocs.io/en/latest/
MIT License
71 stars 25 forks source link

Can't run template notebooks "ModuleNotFoundError: No module named 'torch.utils._import_utils'" #1150

Open givison opened 1 month ago

givison commented 1 month ago

Hi Angelo folks!

Trying to get started running the analysis notebooks. Followed the install directions in the readme, tried cloning & using conda and installing from pip and getting the same error when I try to load the libraries at the top of both notebook 1 & notebook 2:


ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 12 8 from matplotlib import rc_file_defaults 10 from ark.phenotyping import (pixel_cluster_utils, pixel_meta_clustering, 11 pixel_som_clustering, pixie_preprocessing) ---> 12 from ark.utils import data_utils, example_dataset, plot_utils 13 from ark.utils.metacluster_remap_gui import (MetaClusterGui, 14 colormap_helper, 15 metaclusterdata_from_files)

File ~/miniconda3/envs/ark_env/lib/python3.10/site-packages/ark/utils/data_utils.py:25 23 from anndata.experimental import AnnCollection 24 from anndata.experimental.multi_files._anncollection import ConvertType ---> 25 from torchdata.datapipes.iter import IterDataPipe 26 from typing import Iterator, Optional 27 try:

File ~/miniconda3/envs/ark_env/lib/python3.10/site-packages/torchdata/datapipes/init.py:11 7 from torch.utils.data import DataChunk, functional_datapipe 9 from torchdata import _extension # noqa: F401 ---> 11 from . import iter, map, utils 13 all = ["DataChunk", "functional_datapipe", "iter", "map", "utils"] 16 from torchdata import deprecation_warning

File ~/miniconda3/envs/ark_env/lib/python3.10/site-packages/torchdata/datapipes/iter/init.py:79 68 from torchdata.datapipes.iter.transform.callable import ( 69 BatchAsyncMapperIterDataPipe as BatchAsyncMapper, 70 BatchMapperIterDataPipe as BatchMapper, (...) 76 ThreadPoolMapperIterDataPipe as ThreadPoolMapper, 77 ) 78 from torchdata.datapipes.iter.util.bz2fileloader import Bz2FileLoaderIterDataPipe as Bz2FileLoader ---> 79 from torchdata.datapipes.iter.util.cacheholder import ( 80 EndOnDiskCacheHolderIterDataPipe as EndOnDiskCacheHolder, 81 InMemoryCacheHolderIterDataPipe as InMemoryCacheHolder, 82 OnDiskCacheHolderIterDataPipe as OnDiskCacheHolder, 83 ) 84 from torchdata.datapipes.iter.util.combining import ( 85 IterKeyZipperIterDataPipe as IterKeyZipper, 86 MapKeyZipperIterDataPipe as MapKeyZipper, 87 RoundRobinDemultiplexerIterDataPipe as RoundRobinDemultiplexer, 88 UnZipperIterDataPipe as UnZipper, 89 ) 90 from torchdata.datapipes.iter.util.cycler import CyclerIterDataPipe as Cycler, RepeaterIterDataPipe as Repeater

File ~/miniconda3/envs/ark_env/lib/python3.10/site-packages/torchdata/datapipes/iter/util/cacheholder.py:24 21 except ImportError: 22 portalocker = None ---> 24 from torch.utils._import_utils import dill_available 25 from torch.utils.data.datapipes.utils.common import _check_unpickable_fn 27 from torch.utils.data.graph import traverse_dps

ModuleNotFoundError: No module named 'torch.utils._import_utils'

givison commented 1 month ago

Quick update here, I was able to unblock myself by installing torchdata 0.7.1! Seems like an incompatibility between torchdata 0.8.0 (newest release as of about a week ago) and the torch==2.2.0 pin here