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 #54369

Closed
sijia-w opened this issue Feb 14, 2022 · 13 comments
Closed
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:macOS macOS Build/Installation issues TF 2.7 Issues related to TF 2.7.0 type:build/install Build and install issues

Comments

@sijia-w
Copy link

sijia-w commented Feb 14, 2022

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

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: #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.

@sijia-w sijia-w added the type:build/install Build and install issues label Feb 14, 2022
@mohantym mohantym added subtype:macOS macOS Build/Installation issues TF 2.7 Issues related to TF 2.7.0 labels Feb 14, 2022
@mohantym
Copy link
Contributor

Hi @sijia-w ! Please change your command "pip install tensorflow_text" to "pip install tensorflow-text" . You can import tensorflow -text with this command "import tensorflow_text as tf_text" after that. Thanks!

@mohantym mohantym added the stat:awaiting response Status - Awaiting response from author label Feb 14, 2022
@sijia-w
Copy link
Author

sijia-w commented Feb 14, 2022

Hi @mohantym Thanks a lot for your quick response! Unfortunately, still the same error.

image

@mohantym mohantym removed the stat:awaiting response Status - Awaiting response from author label Feb 14, 2022
@mohantym
Copy link
Contributor

Hi @sijia-w ! Could you please post on Tensorflow-text repo ?Attaching relevant thread for reference. Thanks!

@sijia-w
Copy link
Author

sijia-w commented Feb 14, 2022

Hi @mohantym, Sure! See tensorflow/text#837. Shall I close this issue?

@mohantym
Copy link
Contributor

Ok @sijia-w ! Closing this issue here as it will be tracked in Tensorflow-text repo. Thanks!

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@mohantym
Copy link
Contributor

Hi @sijia-w !
Re-opening as requested.
Thank you!

@mohantym mohantym reopened this Nov 28, 2022
@mohantym mohantym removed their assignment Nov 28, 2022
@sijia-w
Copy link
Author

sijia-w commented Nov 30, 2022

@mohantym I used it in Google Colab. Is this issue re-opened automatically? Shall I close it?

@tilakrayal
Copy link
Contributor

@sijia-w,
Have you got the chance to have a look at this PR tensorflow/text#756 for the similar feature for Apple Silicon support. By installing tensorflow-macos 2.6.0 and tensorflow-metal 0.2.0, TF.Text can be compiled from source code(Currently Apple does not provide a preview version of tensorflow-macos and tf-nightly, so TF.Text can only build a stable version.). The PR was also merged.

Also the similar issue was already being tracked in the tensorflow-text repo for the same. tensorflow/text#823. Thank you!

@tilakrayal tilakrayal added the stat:awaiting response Status - Awaiting response from author label Feb 13, 2023
@tilakrayal tilakrayal self-assigned this Feb 13, 2023
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Feb 20, 2023
@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@luis-arellano
Copy link

I'm running into the same issue. I have a mac with M1.
ERROR: Could not find a version that satisfies the requirement tensorflow-text (from versions: none)
ERROR: No matching distribution found for tensorflow-text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:macOS macOS Build/Installation issues TF 2.7 Issues related to TF 2.7.0 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

4 participants