tensorflow / text

Making text a first-class citizen in TensorFlow.
https://www.tensorflow.org/beta/tutorials/tensorflow_text/intro
Apache License 2.0
1.22k stars 335 forks source link

Universal distribution / Windows binaries #44

Closed sbarman25 closed 3 years ago

sbarman25 commented 5 years ago

Hello,

Is it possible to add Windows binaries / universal distribution? I couldn,'t install this library on Windows, no wonder there are no binaries for windows on pypi .

tensorflow-probability project provides universal distribution. See pypi .

I don't know if it's a problem with how bazel build is configured or something else. It would be great to have it on all platforms.

Many Thanks.

broken commented 5 years ago

Windows is something we do wish to add. We've had some difficulties getting a working package though, which is why it is not available yet. The difference between this library and tensorflow-probability is we make use of custom ops written in c++, and building those shared libraries to work well with Tensorflow inside Windows has had issues; plus, the lengthy build times on Windows has made iterating on these issues slow. While the next beta release (this week) will not include Windows, we would like for the next release to include it.

eggie5 commented 4 years ago

@broken since these are custom ops, will they be included in the graph when you do a SavedModel export? Will I be able to run these ops from java or TF serving (non-python envs). What do I need to do to run these at inference time?

broken commented 4 years ago

Not all ops are custom ops, but for those that are I've been working with the tf serving team to have our ops included. They'll be available in the next TF serving release for TF 2.0. It will include all (except for normalize) of our currently released ops. Their latest 1.x release was done before my changes to include these ops was added.

We'll add the newest ops once we determine the current build issues with the new TF build environment, but TF serving should have custom build instructions if you want to include anything that is not already included.

u2gilles commented 4 years ago

Do we have a release date for tensorflow-text on Windows?

sbarman25 commented 4 years ago

ok, so Tensorflow SIG-addons is out now. There must be a way to build those shared libraries for Windows. It's already 6 months since I posted this.

JulianGerhard21 commented 4 years ago

Hi guys,

any news on this one?

Kind regards

virattt commented 4 years ago

Bumping this. Would be really, really great if we could use tensorflow-text on Windows 10... 🙏

AndyForest commented 4 years ago

In the meantime, could you update the README to mention that this package is not available for Windows? I know the Python Package Index only lists Linux and MacOS downloads, but it took me a lot of time of troubleshooting to notice that.

Thanks for the awesome code, by the way! I have it working in a Colab notebook instead now to be in a Linux environment.

IzioDev commented 4 years ago

Sad we can't use this package on Windows

cristianmtr commented 4 years ago

Any news on this? Timeline?

Mlallena commented 4 years ago

This issue was mentioned nearly a year ago, and so far no official news on Tensorflow-Text for Windows. Will we eventually get it, or will we be forced to keep to Colab (or other OS, of course) to be able to use it for the long term?

broken commented 4 years ago

We were trying to get this into 2.3.x, but missed the deadline. I expect a Windows release with 2.4.

tmbo commented 4 years ago

awesome that sounds super exciting 🚀 what's the timeline for that 2.4 release?

icoxfog417 commented 4 years ago

The lack of Windows suport breaks the usage of TensorFlow Hub in Windows. The delay of supporting Windows harms the experience of TensorFlow ecosystem, especially in NLP.

https://tfhub.dev/google/universal-sentence-encoder-multilingual/3

aamin21 commented 4 years ago

@broken Any ETA on the 2.4 release? Thank you!

broken commented 4 years ago

We release our versions in sync with the core TF branch, but may release a beta earlier if we're ready but the core branch doesn't look to release soon. Apologies, but at this time, I can't give a specific date.

hoefling commented 3 years ago

Just a friendly reminder that Tensorflow has published first release candidate of 2.4.0 which looks stable enough to develop & test against.

broken commented 3 years ago

We just release 2.4.0-rc0. This includes packages for Windows. I encourage everybody to test them out, as we haven't had a significant amount of time to test them.

Note that the build for Py3.8 was incorrect and will not work. This will be fixed for the next release. However, Py3.6 and Py3.7 should work.

jfillies commented 3 years ago

@broken thank you!

broken commented 3 years ago

We just released 2.4.0-rc1 that includes a working build for Py3.8. This is the first release using the automated build, but I don't think it will be too different from the previous release candidate which appears to be working well. Thanks everybody for your patience; it was surprisingly tricky to get right.

GaneshGS commented 3 years ago

Hi tensorflow-text 2.4.0-rc1 is still not working in windows 10 for python 3.8. versions. I installed it in Anaconda environment and running on my windows machine. Is it not compatible with Anaconda? Do I need to download any other dependencies? If it works for anyone, please let me know.

broken commented 3 years ago

@GaneshGS The closest I've tested would be miniconda on linux or just normal install on Windows. Can you open a new issue for this? Please include how you installed it, the error message you got, and what you did to get the error. Thanks.

GaneshGS commented 3 years ago

@broken, Hi, sure. I can open a new issue for this problem.

hoefling commented 3 years ago

Not sure about conda, but I can confirm the package works with tensorflow-cpu==2.4.0 with the normal Python distribution. Quick test to verify:

>cd %TEMP%
>py -3.8 -m venv tf-text
>tf-text\Scripts\activate.bat
(tf-text) >pip install tensorflow-text==2.4.0rc1; pip install tensorflow-cpu==2.4.0 "numpy<1.19.4"
(tf-text) >python
Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.platform
'win32'
>>> import tensorflow_text as text
>>> tokenizer = text.WhitespaceTokenizer()
>>> tokens = tokenizer.tokenize(['everything not saved will be lost.', u'Sad☹'.encode('UTF-8')])
2020-12-16 21:58:08.508903: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
2020-12-16 21:58:08.509878: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING:tensorflow:From C:\Users\tester\AppData\Local\Temp\tst\lib\site-packages\tensorflow\python\util\dispatch.py:201: batch_gather (from tensorflow.python.ops.array_ops) is deprecated and will be removed after 2017-10-25.
Instructions for updating:
`tf.batch_gather` is deprecated, please use `tf.gather` with `batch_dims=-1` instead.
>>> tokens.to_list()
[[b'everything', b'not', b'saved', b'will', b'be', b'lost.'], [b'Sad\xe2\x98\xb9']]

Downgrade of numpy is necessary because of https://github.com/numpy/numpy/issues/16744 and we are stuck with the broken win10 2004 build.

Awesome! @broken thank you for the great work! :fireworks:

GaneshGS commented 3 years ago

@hoefling Thanks a lot for the inputs! I used tensroflow-cpu==2.4.0 and my problem is solved. Thanks a lot! @broken, I'll close the other issue which created sometime ago.