Intento reprdoducir el notebook sobre Google Multilingual Universal Encoder. Sin embargo al descargar las librerias necesidas como tensorflow_text
:
%%capture
#@title Setup Environment
# Install the latest Tensorflow version.
!pip3 install tensorflow_text
o
!python -m pip install tensorflow_text
Me salé jupyter:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-48-399dd4157896> in <module>
8 import tensorflow.compat.v2 as tf
9 import tensorflow_hub as hub
---> 10 from tensorflow_text import SentencepieceTokenizer
11 import sklearn.metrics.pairwise
12
ModuleNotFoundError: No module named 'tensorflow_text'
Intenté instalarlo con python -m pip install tensorflow-text
, pero me da:
(seg_env) C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>python -m pip install tensorflow-text
Collecting tensorflow-text
ERROR: Could not find a version that satisfies the requirement tensorflow-text (from versions: none)
ERROR: No matching distribution found for tensorflow-text
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Tambien intenté en conda install -c conda-forge tensorflow
(seg_env) C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment> conda install -c conda-forge tensorflow
Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>set "KERAS_BACKEND="
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>python C:\Users\antoi\.conda\envs\seg_env\etc\keras\load_config.py 1>temp.txt
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>set /p KERAS_BACKEND= 0<temp.txt
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>del temp.txt
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>python -c "import keras" 1>nul 2>&1
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>if errorlevel 1 (
ver 1>nul
set "KERAS_BACKEND=theano"
python -c "import keras" 1>nul 2>&1
)
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>SET DISTUTILS_USE_SDK=1
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>SET MSSdk=1
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>SET platform=
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>IF /I [AMD64] == [amd64] set "platform=true"
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>IF /I [] == [amd64] set "platform=true"
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>if defined platform (set "VSREGKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0" ) ELSE (set "VSREGKEY=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\14.0" )
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>for /F "skip=2 tokens=2,*" %A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0" /v InstallDir') do SET "VSINSTALLDIR=%B"
ERROR: The system was unable to find the specified registry key or value.
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>if "" == "" (set "VSINSTALLDIR=" )
C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>if "" == "" (
ECHO "WARNING: Did not find VS in registry or in VS140COMNTOOLS env var - your compiler may not work"
GOTO End
)
"WARNING: Did not find VS in registry or in VS140COMNTOOLS env var - your compiler may not work"
The system cannot find the batch label specified - End
Actualizacion
Hicé python -m pip install tensorflow-text
en el terminal y !python -m pip install tensorflow-text
. El primero me devuelve:
(seg_env) C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation\sentiment>python -m pip install tensorflow-text
Collecting tensorflow-text
ERROR: Could not find a version that satisfies the requirement tensorflow-text (from versions: none)
ERROR: No matching distribution found for tensorflow-text
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
El segundo no me devuelve nada en el notebook. Así que no estoy seguro de que haya subido nada.
Luego estoy tratando de cargarlo en el cuaderno.:
from tensorflow_text import SentencepieceTokenizer
Pero me devuelve:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-52-399dd4157896> in <module>
8 import tensorflow.compat.v2 as tf
9 import tensorflow_hub as hub
---> 10 from tensorflow_text import SentencepieceTokenizer
11 import sklearn.metrics.pairwise
12
ModuleNotFoundError: No module named 'tensorflow_text'
Y, con tensorflow-text
:
File "<ipython-input-53-9d3d22c2bd52>", line 10
from tensorflow-text import SentencepieceTokenizer
^
SyntaxError: invalid syntax
Documentacion
Parece que:
TensorFlow Text requires TensorFlow 2.0, and is fully compatible with eager mode and graph mode.
Entonces hicé pip install --upgrade tensorflow
:
Pero me devuelve:
Successfully built wrapt gast opt-einsum
ERROR: tensorboard 2.1.0 has requirement grpcio>=1.24.3, but you'll have grpcio 1.23.0 which is incompatible.
Installing collected packages: oauthlib, urllib3, chardet, idna, requests, requests-oauthlib, cachetools, pyasn1, pyasn1-modules, rsa, google-auth, google-auth-oauthlib, tensorboard, wrapt, gast, opt-einsum, google-pasta, tensorflow-estimator, tensorflow
Attempting uninstall: tensorboard
Found existing installation: tensorboard 1.13.1
Uninstalling tensorboard-1.13.1:
Successfully uninstalled tensorboard-1.13.1
Attempting uninstall: gast
Found existing installation: gast 0.3.3
Uninstalling gast-0.3.3:
Successfully uninstalled gast-0.3.3
Attempting uninstall: tensorflow-estimator
Found existing installation: tensorflow-estimator 1.13.0
Uninstalling tensorflow-estimator-1.13.0:
Successfully uninstalled tensorflow-estimator-1.13.0
Attempting uninstall: tensorflow
Found existing installation: tensorflow 1.13.2
Uninstalling tensorflow-1.13.2:
Successfully uninstalled tensorflow-1.13.2
Successfully installed cachetools-4.0.0 chardet-3.0.4 gast-0.2.2 google-auth-1.11.2 google-auth-oauthlib-0.4.1 google-pasta-0.1.8 idna-2.8 oauthlib-3.1.0 opt-einsum-3.1.0 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-2.22.0 requests-oauthlib-1.3.0 rsa-4.0 tensorboard-2.1.0 tensorflow-2.1.0 tensorflow-estimator-2.1.0 urllib3-1.25.8 wrapt-1.12.0
(seg_env) C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation>python
Python 3.6.7 (default, Dec 6 2019, 07:03:06) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow_text import SentencepieceTokenizer
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow_text'
Entonces traté de installarlo:
(seg_env) C:\Users\antoi\Documents\Programming\Covent Garden\Segmentation>python -m pip install tensorflow-text
ERROR: Could not find a version that satisfies the requirement tensorflow-text (from versions: none)
ERROR: No matching distribution found for tensorflow-text