Windows and Sentence Piece
See original GitHub issue🐛 Bug
Describe the bug
It appears one of the requirements sentencepiece is not built for windows machines.
This causes an import error:
1 import torch
----> 2 import torchtext
3 import numpy as np
4 import pandas as pd
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-dev\lib\site-packages\torchtext\__init__.py in <module>
----> 1 from . import data
2 from . import datasets
3 from . import utils
4 from . import vocab
5 from . import experimental
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-dev\lib\site-packages\torchtext\data\__init__.py in <module>
8 from .pipeline import Pipeline
9 from .utils import get_tokenizer, interleave_keys
---> 10 from .functional import generate_sp_model, \
11 load_sp_model, \
12 sentencepiece_numericalizer, \
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-dev\lib\site-packages\torchtext\data\functional.py in <module>
----> 1 import sentencepiece as spm
2 import re
3
4 __all__ = [
5 "generate_sp_model", "load_sp_model",
ModuleNotFoundError: No module named 'sentencepiece'
Expected behavior module imports without issue.
Environment
Please copy and paste the output from our environment collection script (or fill out the checklist below manually).
You can get the script and run it with:
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
python -c "import torchtext; print(\"torchtext version is \", torchtext.__version__)"
- PyTorch Version (e.g., 1.0): latest
- OS (e.g., Linux): Windows
- How you installed PyTorch (
conda
,pip
, source): conda - Build command you used (if compiling from source):N/A
- Python version:3.6
- CUDA/cuDNN version:
- GPU models and configuration:
- Any other relevant information: Install torchtext from conda.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Windows Support · Issue #178 · google/sentencepiece - GitHub
Although it is not officially announced, Windows support is almost completed and binary package including python-wheel is built on appveyor.
Read more >sentencepiece - PyPI
Build and Install SentencePiece For Linux (x64/i686), macOS, and Windows(win32/x64) environment, you can simply use pip command to install SentencePiece python ...
Read more >SentencePiece Tokenizer Demystified | by Jonathan Kernes
It's actually a method for selecting tokens from a precompiled list, optimizing the tokenization process based on a supplied corpus.
Read more >Sentencepiece - :: Anaconda.org
SentencePiece is an unsupervised text tokenizer and detokenizer mainly for Neural Network-based text generation systems where the vocabulary size is ...
Read more >Highlight your text - Microsoft Support
The text highlighter on the ribbon in PowerPoint. Choose a color. The text you selected will be highlighted in the color you chose....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. It’s currently python-only package but we may expand it with some cpp soon. And a noarch package is what we are doing now.
It seems the sentencepiece packages are hosted on PyPI. https://pypi.org/project/sentencepiece/0.1.85/#files