text
text copied to clipboard
Installing torchdata results in torchtext breaking
🐛 Bug
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
MacOS Monterey 12.2.1 - terminal - bash
conda install pytorch torchvision torchaudio torchtext -c pytorch -y
# all packages import
# now install torchdata
git clone https://github.com/pytorch/data.git
cd data
python setup.py install
# open python and run in python
import torchtext
>>> import torchtext
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/miniconda3/envs/testenv/lib/python3.9/site-packages/torchtext/__init__.py", line 12, in <module>
from . import data, datasets, functional, models, nn, transforms, utils, vocab
File "/opt/miniconda3/envs/testenv/lib/python3.9/site-packages/torchtext/datasets/__init__.py", line 3, in <module>
from .ag_news import AG_NEWS
File "/opt/miniconda3/envs/testenv/lib/python3.9/site-packages/torchtext/datasets/ag_news.py", line 12, in <module>
from torchdata.datapipes.iter import FileOpener, IterableWrapper
File "/Users/parsaakbari/Downloads/data/torchdata/__init__.py", line 9, in <module>
from . import datapipes
File "/Users/parsaakbari/Downloads/data/torchdata/datapipes/__init__.py", line 9, in <module>
from . import iter, map, utils
File "/Users/parsaakbari/Downloads/data/torchdata/datapipes/iter/__init__.py", line 68, in <module>
from torchdata.datapipes.iter.transform.callable import (
File "/Users/parsaakbari/Downloads/data/torchdata/datapipes/iter/transform/callable.py", line 10, in <module>
from torch.utils.data.datapipes.utils.common import _check_unpickable_fn
ImportError: cannot import name '_check_unpickable_fn' from 'torch.utils.data.datapipes.utils.common' (/opt/miniconda3/envs/testenv/lib/python3.9/site-packages/torch/utils/data/datapipes/utils/common.py)
Expected behavior A clear and concise description of what you expected to happen. I expect torchtext to import after I install torchdata
Screenshots If applicable, add screenshots to help explain your problem.
Environment
Please copy and paste the output from our environment collection script (or
Collecting environment information...
PyTorch version: 1.12.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A
OS: macOS 12.2.1 (arm64)
GCC version: Could not collect
Clang version: 13.1.6 (clang-1316.0.21.2.5)
CMake version: Could not collect
Libc version: N/A
Python version: 3.9.12 (main, Jun 1 2022, 06:34:44) [Clang 12.0.0 ] (64-bit runtime)
Python platform: macOS-12.2.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
Versions of relevant libraries:
[pip3] numpy==1.22.3
[pip3] torch==1.12.0
[pip3] torchaudio==0.12.0
[pip3] torchdata==0.5.0a0+7e0041b
[pip3] torchtext==0.13.0
[pip3] torchvision==0.13.0
[conda] numpy 1.22.3 py39h25ab29e_0
[conda] numpy-base 1.22.3 py39h974a1f5_0
[conda] pytorch 1.12.0 py3.9_0 pytorch
[conda] torchaudio 0.12.0 py39_cpu pytorch
[conda] torchdata 0.5.0a0+7e0041b pypi_0 pypi
[conda] torchtext 0.13.0 py39 pytorch
[conda] torchvision 0.13.0 py39_cpu pytorch
- PyTorch Version (e.g., 1.0):
- OS (e.g., Linux): MacOS Monterey 12.2.1
- How you installed PyTorch (
conda,pip, source): conda - Build command you used (if compiling from source):
- Python version: 3.9
- CUDA/cuDNN version:
- GPU models and configuration:
- Any other relevant information:
Additional context Add any other context about the problem here.
@ParsaAkbari can you try installing the latest stable release of torchdata (i.e. conda install -c pytorch torchdata). According to the version compatibility guide on torchdata's GitHub repo, torchdata=0.4.0 is compatible with torch=1.12.0. If you want to install torchdata from source, you should also install pytorch from source.
cc @ejguan
@ParsaAkbari You might need to install torchdata manually by downloading and running python setup.py develop since torchdata has not provided binaries for m1.
@ParsaAkbari
The binaries for arm64 becomes available for nightly release. You can get them via: conda install pytorch torchdata -c pytorch-nightly.
And, for the coming torchdata 0.4.1 minor releases, you will be able to get arm64 build of torchdata using conda install pytorch torchdata -c pytorch.
@ParsaAkbari going to close out this issue. Lmk if you're still unable to resolve this with the suggestion from @ejguan