Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install tensorflow_text in virtual environment of python 3.8 mac m1 #837

Closed
sijia-w opened this issue Feb 14, 2022 · 2 comments
Closed
Labels
duplicate This issue or pull request already exists

Comments

@sijia-w
Copy link

sijia-w commented Feb 14, 2022

System information

Describe the problem
To use the xx_use_md model, I started a virtualenv.

I tried to load the model by

import spacy_universal_sentence_encoder
nlp = spacy_universal_sentence_encoder.load_model('xx_use_md')

Then, I encountered the error:

FileNotFoundError: Op type not registered 'SentencepieceOp' in binary running on MacBook-Air. Make sure the Op and Kernel are registered in the binary running in this process. Note that if you are loading a saved graph which used ops from tf.contrib, accessing (e.g.) `tf.contrib.resampler` should be done before importing the graph, as contrib ops are lazily registered when the module is first accessed.
 You may be trying to load on a different device from the computational device. Consider setting the `experimental_io_device` option in `tf.saved_model.LoadOptions` to the io_device such as '/job:localhost'.

Guided by the discussion here: tensorflow/tensorflow#38597, I tried to install tensorflow-text in the virtualenv via pip3, but this raised another error:

ERROR: Could not find a version that satisfies the requirement tensorflow-text (from versions: none)
ERROR: No matching distribution found for tensorflow-text

Additionally, I tried to load the model by

import spacy
nlp = spacy.load('xx_use_md')

which raised the error

OSError: [E050] Can't find model 'xx_use_md'. It doesn't seem to be a Python package or a valid path to a data directory.

Then, I used the command pip3 install https://github.com/MartinoMensio/spacy-universal-sentence-encoder-tfhub/releases/download/xx_use_md-0.2.1/xx_use_md-0.2.1.tar.gz#xx_use_md-0.2.1 on https://pypi.org/project/spacy-universal-sentence-encoder/0.2.1/ . Another error happened:

ERROR: Could not find a version that satisfies the requirement tensorflow==2.1.0 (from spacy-universal-sentence-encoder) (from versions: none)
ERROR: No matching distribution found for tensorflow==2.1.0

It is impossible to use the 'xx_use_md' model by import spacy or import spacy_universal_sentence_encoder in the virtualenv. However, when I tried with the same code on Colab, similar errors occurred and were resolved by installing and importing tensowflow_text.

Relevant issue: #89 (comment)

@broken
Copy link
Member

broken commented Feb 14, 2022

We currently do not have prebuilt packages for Mac M1. Please look at issue #823 or pr #756 for more info.

@broken broken added the duplicate This issue or pull request already exists label Feb 14, 2022
@broken
Copy link
Member

broken commented Feb 14, 2022

Closing as dupe since we have other issues opened regarding this subject.

@broken broken closed this as completed Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants