Closed nilpath closed 2 years ago
Did you use this command(conda install -c apple tensorflow-deps==2.8.0
)? Usually this problem occurs when the version of protobuf
does not match (greater than 3.19.x
).
Hi!
apparently I were using tensorflow-deps==2.9.0
so I downgraded that
however I get this unrelated error when trying to run my service that is using tensorflow
TypeError: Descriptors cannot not be created directly.
E If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
E If you cannot immediately regenerate your protos, some other possible workarounds are:
E 1. Downgrade the protobuf package to 3.20.x or lower.
E 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
E
E More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
previously i solved it by manuall installing protobuf==3.20.0
which then results in the first error
~hmm could there be an issue that the service I install tensorflow-text into requires me to install 3.20.0 while it wants 3.19.5?~
nah did not help to downgrade it
looks like tensorflow-deps 2.8.0 and tensorflow-macos installs different versions of protobuf might have some
@nilpath Things are a little confusing, and we need to keep our heads up.
tensorflow-macos
, tensorflow-text
and tensorflow-deps
need to be the same. For example tensorflow-macos 2.8.0
, tensorflow-text 2.8.0
and tensorflow-deps 2.8.0
, I told you to install tensorflow-deps 2.8.0
because of the previous issue. Now it seems that you need to use 2.9.0
.protobuf
is automatically matched by tensorflow-deps
, and there is no need to manually change it yourself. protobuf
depends on the C library of libprotobuf
, and manual installation often produces mismatch errors (you can find import protobuf
errors).text 2.9.0
please switch to branch v2.9
, now it seems that you did not read this tutorial clearly, completely referring to this tutorial should not cause the problem of manually modifying protobuf
.I hope you can provide conda
environment and package information for the build.
@nilpath Things are a little confusing, and we need to keep our heads up.
- The major versions of
tensorflow-macos
,tensorflow-text
andtensorflow-deps
need to be the same. For exampletensorflow-macos 2.8.0
,tensorflow-text 2.8.0
andtensorflow-deps 2.8.0
, I told you to installtensorflow-deps 2.8.0
because of the previous issue. Now it seems that you need to use2.9.0
.
Yeah, I'm still aiming for a tf text version that should work with tensorflow 2.8.x 😄
- Build and use are not the same, please do not build and use in the same environment, it is easy to cause unknown errors. Here I strongly recommend that you re-create a new environment to build.
Yes I have a separate environment for the service in which I'm installing and using the *.whl
protobuf
is automatically matched bytensorflow-deps
, and there is no need to manually change it yourself.protobuf
depends on the C library oflibprotobuf
, and manual installation often produces mismatch errors (you can findimport protobuf
errors).
The issue with protobuf, both in the build and usage environments, is that it complains about the version when i try to import tensorflow. (tensorflow-macos 2.8.0 installed)
- To build
text 2.9.0
please switch to branchv2.9
, now it seems that you did not read this tutorial clearly, completely referring to this tutorial should not cause the problem of manually modifyingprotobuf
.
No I've read it multiple of times, and I switched out 2.9.0 for 2.8.0 and checkout the branch v2.8. (some feedback though would be to update step 4 to actually mention checking out the branch and not download the taged release as using the tags was casing me issue initially)
these are the conda and pip packages installed in the build environment which includes a downgrade of protobuf in both conda and pip list
pre downgrading protobuf it seems to be set to protobuf==4.21.7
conda packages
# packages in environment at /Users/.../miniforge3/envs/tensorflow-macos:
#
# Name Version Build Channel
absl-py 1.2.0 pypi_0 pypi
astunparse 1.6.3 pypi_0 pypi
bzip2 1.0.8 h3422bc3_4 conda-forge
c-ares 1.18.1 h3422bc3_0 conda-forge
ca-certificates 2022.9.24 h4653dfc_0 conda-forge
cached-property 1.5.2 hd8ed1ab_1 conda-forge
cached_property 1.5.2 pyha770c72_1 conda-forge
cachetools 5.2.0 pypi_0 pypi
certifi 2022.9.24 pypi_0 pypi
charset-normalizer 2.1.1 pypi_0 pypi
flatbuffers 22.9.24 pypi_0 pypi
gast 0.5.3 pypi_0 pypi
google-auth 2.12.0 pypi_0 pypi
google-auth-oauthlib 0.4.6 pypi_0 pypi
google-pasta 0.2.0 pypi_0 pypi
grpc-cpp 1.48.1 h55edf5b_1 conda-forge
grpcio 1.48.1 py38h9dcc83b_1 conda-forge
h5py 3.6.0 nompi_py38hacf61ce_100 conda-forge
hdf5 1.12.1 nompi_hd9dbc9e_104 conda-forge
idna 3.4 pypi_0 pypi
importlib-metadata 5.0.0 pypi_0 pypi
keras 2.8.0 pypi_0 pypi
keras-preprocessing 1.1.2 pypi_0 pypi
krb5 1.19.3 he492e65_0 conda-forge
libabseil 20220623.0 cxx17_h28b99d4_4 conda-forge
libblas 3.9.0 16_osxarm64_openblas conda-forge
libcblas 3.9.0 16_osxarm64_openblas conda-forge
libclang 14.0.6 pypi_0 pypi
libcurl 7.85.0 h1c293e1_0 conda-forge
libcxx 14.0.6 h2692d47_0 conda-forge
libedit 3.1.20191231 hc8eb9b7_2 conda-forge
libev 4.33 h642e427_1 conda-forge
libffi 3.4.2 h3422bc3_5 conda-forge
libgfortran 5.0.0 11_3_0_hd922786_25 conda-forge
libgfortran5 11.3.0 hdaf2cc0_25 conda-forge
liblapack 3.9.0 16_osxarm64_openblas conda-forge
libnghttp2 1.47.0 h519802c_1 conda-forge
libopenblas 0.3.21 openmp_hc731615_3 conda-forge
libprotobuf 3.21.7 hb5ab8b9_0 conda-forge
libsqlite 3.39.4 h76d750c_0 conda-forge
libssh2 1.10.0 h7a5bd25_3 conda-forge
libzlib 1.2.12 h03a7124_4 conda-forge
llvm-openmp 14.0.4 hd125106_0 conda-forge
markdown 3.4.1 pypi_0 pypi
markupsafe 2.1.1 pypi_0 pypi
ncurses 6.3 h07bb92c_1 conda-forge
numpy 1.21.6 py38hf29d37f_0 conda-forge
oauthlib 3.2.1 pypi_0 pypi
openssl 3.0.5 h03a7124_2 conda-forge
opt-einsum 3.3.0 pypi_0 pypi
pip 22.2.2 pyhd8ed1ab_0 conda-forge
protobuf 3.19.4 pypi_0 pypi
pyasn1 0.4.8 pypi_0 pypi
pyasn1-modules 0.2.8 pypi_0 pypi
python 3.8.13 hd3575e6_0_cpython conda-forge
python_abi 3.8 2_cp38 conda-forge
re2 2022.06.01 h9a09cb3_0 conda-forge
readline 8.1.2 h46ed386_0 conda-forge
requests 2.28.1 pypi_0 pypi
requests-oauthlib 1.3.1 pypi_0 pypi
rsa 4.9 pypi_0 pypi
setuptools 65.4.1 pyhd8ed1ab_0 conda-forge
six 1.15.0 pypi_0 pypi
sqlite 3.39.4 h2229b38_0 conda-forge
tensorboard 2.8.0 pypi_0 pypi
tensorboard-data-server 0.6.1 pypi_0 pypi
tensorboard-plugin-wit 1.8.1 pypi_0 pypi
tensorflow-deps 2.8.0 0 apple
tensorflow-macos 2.8.0 pypi_0 pypi
tensorflow-metal 0.5.0 pypi_0 pypi
termcolor 2.0.1 pypi_0 pypi
tf-estimator-nightly 2.8.0.dev2021122109 pypi_0 pypi
tk 8.6.12 he1e0b03_0 conda-forge
typing-extensions 4.4.0 pypi_0 pypi
urllib3 1.26.12 pypi_0 pypi
werkzeug 2.2.2 pypi_0 pypi
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
wrapt 1.14.1 pypi_0 pypi
xz 5.2.6 h57fd34a_0 conda-forge
zipp 3.9.0 pypi_0 pypi
zlib 1.2.12 h03a7124_4 conda-forge
pip packages
Package Version
----------------------- -------------------
absl-py 1.2.0
astunparse 1.6.3
cached-property 1.5.2
cachetools 5.2.0
certifi 2022.9.24
charset-normalizer 2.1.1
flatbuffers 22.9.24
gast 0.5.3
google-auth 2.12.0
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
grpcio 1.48.1
h5py 3.6.0
idna 3.4
importlib-metadata 5.0.0
keras 2.8.0
Keras-Preprocessing 1.1.2
libclang 14.0.6
Markdown 3.4.1
MarkupSafe 2.1.1
numpy 1.21.6
oauthlib 3.2.1
opt-einsum 3.3.0
pip 22.2.2
protobuf 3.19.4
pyasn1 0.4.8
pyasn1-modules 0.2.8
requests 2.28.1
requests-oauthlib 1.3.1
rsa 4.9
setuptools 65.4.1
six 1.15.0
tensorboard 2.8.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow-macos 2.8.0
tensorflow-metal 0.5.0
termcolor 2.0.1
tf-estimator-nightly 2.8.0.dev2021122109
typing_extensions 4.4.0
urllib3 1.26.12
Werkzeug 2.2.2
wheel 0.37.1
wrapt 1.14.1
zipp 3.9.0
I've noticed a weird issue in conda though that after installing tensorflow-deps 2.8.0 it switches my python version from 3.8 to 3.10.. deactivating and activating the conda env fixes it though
There are several questions based on the available information.
tensorflow-metal
does not match, it should be 0.4
.tensorflow-macos 2.8.0
only supports Python 3.8 and 3.9
.I've noticed a weird issue in conda though that after installing tensorflow-deps 2.8.0 it switches my python version from 3.8 to 3.10.. deactivating and activating the conda env fixes it though
Did you update to the latest conda?
I forgot a very important information, have you cleaned the cache of bazel
? The path is in /private/var/tmp/_bazel_your_username/
. bazel
will use the compile cache to speed up the compilation, but it will also cause the previous error is reserved.
I've noticed a weird issue in conda though that after installing tensorflow-deps 2.8.0 it switches my python version from 3.8 to 3.10.. deactivating and activating the conda env fixes it though
Did you update to the latest conda?
yes i did
still same results
still have the same issue
I now notice that we might have missunderstood each other regarding the branch checkout...
I thought we were discussing which branch to checkout in tensorflow-text but I now realise that you might have ment to checkout the v2.8 branch in this repo?
Ok I got it working
I started over from scratch and reinstalled miniforge and bazel and followed your instructions in your v2.8 branch with the additional instructions to install tensorflow-macos 2.8.0 and tensorflow-metal 0.4.0 as well as protobuf 3.20.3
however, I got stuck at a build error and had to follow these instructions https://github.com/tensorflow/text/issues/823#issuecomment-1030305965
after making that fix and reuning the build it I was got a working whl that also were importable in my service
I had similar error messages related to mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')
, it was solved for me by following the tutorial using mamba instead of conda.
hi
so with your help on my previous issue I were able to build and install the tensorflow-text whl.
However, I noticed when continuing working on this, that I still seem to have some problems when importing and using tensorflow-text. This issue do not happen when I install and use the wheel that you have provided.
Any ideas on what may be the issue?