Repository: tensorflow/addons

Issue:
Build Addons for Windows
Splitting this as a separate issue from #77. MacOS should be an achievable goal prior to the 0.3 release. Windows will take a bit longer.


Discussion:
Any progress?
To explain why this is important for Windows users: 

If you want to do rotation augmentation, options are either a python library (e.g. numpy) or image rotate from tensorflow addons. Multiprocessing doesn't really work for Windows, e.g. using keras fit_generator with multiprocessing enable will throw an error, so they best (and fastest) way has been to use tf.data.Dataset with mapping via tf.contrib.image.rotate. With TF2.0 contrib has been removed, so until addons works there is no easy way to do parallel rotation augmentation.
Hi @geometrikal! Thanks for bumping this and explaining the need. There is no progress that I am aware of though the issue is tagged `help wanted` so perhaps someone else could expedite it. 

After we finish the nightly builds I can start working on this issue but it may not be for another month or so. It will certainly be added though as this is high priority per our monthly newsletter. 

I have the same issue as @geometrikal, as I use `tf.data.Dataset`, `map `for preprocessing, there is no workaround for data augmentation with rotations. Please look into it.
@seanpmorgen The see this has the help-wanted tag. What would be the overall steps required to try to get this running on Windows? Just try build from source or does it need a Windows specific build script?
@geometrikal I've created an issue in custom-op repo to discuss the current issue and see how we can get this done.
Any update on Windows or Universal binaries for this package? It is much appreciated to target Windows users as well as *NIX systems.
Hi @sbarman-mi9 we're currently blocked by this issue: https://github.com/tensorflow/custom-op/issues/24

There will need to be some changes on core TensorFlow's side. We'll bring it back up again at this month's meeting to see if we can get some progress. CC @perfinion to see if he has any more information from SIG-Build
Is there any update to this? 
tfa might be quite useful also for windows users :)
Hi @davideboschetto unfortunately this is blocked until progress is made in the issue linked above:
https://github.com/tensorflow/custom-op/issues/24

We'll update this as information is made available.
Hi I also ran into this problem just now!! Why even move it to tf addons and not keep it in 2.0??
Hello :) i know that this is blocked, but would be really nice if there would be any progress. I am stucked at the same point. I dont want to rewrite my code to older tf versions...
The same request there. I'm always waiting from May to now!
I also would like to ask for further action on this issue. It is very useful. Also, is there any workaround suggestion?
Hi @meysamsadeghi (and others). We're really sorry for this not being implemented yet, but it's  outside of the scope of what SIG-Addons is capable of supporting at the moment. 

Please forward your request comments/support to the custom-op issue: https://github.com/tensorflow/custom-op/issues/24 so that it can be prioritized. The roadmap has been laid out, but it needs to be completed.

There are a couple of possible work arounds that I see though:

1. Use [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10) 
2. As a last resort, you could copy addons operations into a fork of tensorflow/tensorflow core repo and compile the custom-ops alongside the entire framework.
Unfortunately WSL does not enable GPU passthrough. I've bumped https://github.com/tensorflow/custom-op/issues/24 with a plea for increased priority.
Thanks to @yifeif this should be unblocked. 
Hi, I'm using Tensorflow 2.0 and I have come to a problem. tf.contrib is not recognized as an attribute and when I try to install tensorflow-addons on my windows machine, it fails. However, it seems to work fine on my Mac. Is there any news or update on this?
@FaraiCH As @seanpmorgan has posted, this is waiting on implementation of custom op in the normal Tensorflow repo. It seems there has been some work done on this so we can be hopeful of some progress soon!
Hi. Is it possible to install TF-Addons on Windows 10 now with pip? If not with pip, is it possible to install it from sources in other ways?
Thank you for your help.
> Hi. Is it possible to install TF-Addons on Windows 10 now with pip? If not with pip, is it possible to install it from sources in other ways?
> Thank you for your help.

Hi @rawhazard not yet, but we're hoping to have a windows CPU package in the very near future
Please add support for windows. I get cryptic error when trying to install this:

```
ERROR: Could not find a version that satisfies the requirement tensorflow-addons (from versions: none)
ERROR: No matching distribution found for tensorflow-addons
```

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -70,6 +70,12 @@
 elif project_name == TFA_NIGHTLY:
     REQUIRED_PACKAGES.append('tf-nightly')
 
+# Manylinux2010 requires a patch for platlib
+if sys.platform.startswith('linux'):
+    ext_modules = [Extension('_foo', ['stub.cc'])]
+else:
+    ext_modules = []
+
 
 class BinaryDistribution(Distribution):
     """This class is needed in order to create OS specific wheels."""
@@ -86,7 +92,7 @@ def has_ext_modules(self):
     author='Google Inc.',
     author_email='opensource@google.com',
     packages=find_packages(),
-    ext_modules=[Extension('_foo', ['stub.cc'])],
+    ext_modules=ext_modules,
     install_requires=REQUIRED_PACKAGES,
     include_package_data=True,
     zip_safe=False,
diff --git a/tensorflow_addons/text/__init__.py b/tensorflow_addons/text/__init__.py
--- a/tensorflow_addons/text/__init__.py
+++ b/tensorflow_addons/text/__init__.py
@@ -35,4 +35,8 @@
 from tensorflow_addons.text.skip_gram_ops import skip_gram_sample_with_text_vocab
 
 # Parse Time
-from tensorflow_addons.text.parse_time_op import parse_time
+
+# Temporarily disable for windwos
+import os
+if os.name != 'nt':
+    from tensorflow_addons.text.parse_time_op import parse_time
diff --git a/tensorflow_addons/utils/resource_loader.py b/tensorflow_addons/utils/resource_loader.py
--- a/tensorflow_addons/utils/resource_loader.py
+++ b/tensorflow_addons/utils/resource_loader.py
@@ -36,4 +36,4 @@ def get_path_to_datafile(path):
       The path to the specified data file
     """
     root_dir = get_project_root()
-    return os.path.join(root_dir, path)
+    return os.path.join(root_dir, path.replace("/", os.sep))


Test patch:
diff --git a/tensorflow_addons/text/parse_time_dummy_test.py b/tensorflow_addons/text/parse_time_dummy_test.py
new file mode 100644
--- /dev/null
+++ b/tensorflow_addons/text/parse_time_dummy_test.py
@@ -0,0 +1,4 @@
+"""Temporary until ParseTime is able to run on windows."""
+from __future__ import absolute_import
+from __future__ import division
+from __future__ import print_function