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

keras-io build failed on windows 10 #16229

Closed
pure-rgb opened this issue Mar 12, 2022 · 25 comments
Closed

keras-io build failed on windows 10 #16229

pure-rgb opened this issue Mar 12, 2022 · 25 comments
Assignees
Labels
stat:awaiting response from contributor type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.

Comments

@pure-rgb
Copy link

Posted here, no response.

I tried to buikd keras-io on windows 10 machine.

pip install -r requirements.txt
cd scripts
python autogen.py make
python autogen.py serve

But when I run python autogen.py make

Traceback (most recent call last):
  File "C:\Users\suz\anaconda3\lib\sre_parse.py", line 1039, in parse_template
    this = chr(ESCAPES[this][1])
KeyError: '\\m'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\suz\anaconda3\lib\multiprocessing\pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "C:\Users\suz\Downloads\keras-io\scripts\autogen.py", line 659, in render_single_file
    md_content = re.sub(
  File "C:\Users\suz\anaconda3\lib\re.py", line 210, in sub
    return _compile(pattern, flags).sub(repl, string, count)
  File "C:\Users\suz\anaconda3\lib\re.py", line 327, in _subx
    template = _compile_repl(template, pattern)
  File "C:\Users\suz\anaconda3\lib\re.py", line 318, in _compile_repl
    return sre_parse.parse_template(repl, pattern)
  File "C:\Users\suz\anaconda3\lib\sre_parse.py", line 1042, in parse_template
    raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \m at position 11
"""

Do I need to install TensorFlow from source to fix this issue ?? 
@tilakrayal
Copy link
Collaborator

@Suzan009 ,
Can you please take a look at this link for the installation.It helps.Thanks!

@tilakrayal tilakrayal added type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited. stat:awaiting response from contributor labels Mar 14, 2022
@pure-rgb
Copy link
Author

@tilakrayal I don't need to build keras itself but the keras-io, here is the repo. https://github.com/keras-team/keras-io

@tilakrayal
Copy link
Collaborator

@Suzan009 ,
Can you please take a look at this link.Thanks!

@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.

@pure-rgb
Copy link
Author

@tilakrayal don't you understand the plain English text that I've written here? Please assign someone else if you can't.

@gadagashwini
Copy link
Contributor

@Suzan009,
To get the Keras-io, Install tensorflow pip install tensorflow.
Keras-io repository hosts the code used to generate the keras.io website.
Keras-io internally calls keras.

!pip install tensorflow 
from tensorflow import keras

@pure-rgb
Copy link
Author

pure-rgb commented Apr 4, 2022

@gadagashwini I have already installed tensorflow. Sorry, why did you think that it might be a tensorflow issue like this?

Here is the thing that I did

git clone https://github.com/keras-team/keras-io.git
activate tensorflow2.7 
pip install -r requirements.txt
cd scripts
python autogen.py make

Please follow the above commands. As I said when I run python autogen.py make, after some while the error occurs, mentioned here.

@gadagashwini
Copy link
Contributor

@Suzan009,
Steps mentioned here are for generating Keras-io document.

I tried the steps

#create python virtual environment 
python -m venv kerasio
#activate env 
source kerasio/bin/activate
#clone Keras-io repo
git clone https://github.com/keras-team/keras-io.git
#Move to Keras-io directory
cd keras-io
#Install requirements.txt
pip install requirements.txt
# Mov to script doc
cd scripts
#run the autogenerated py 
python autogen.py make
#Launch the Keras-io doc
python autogen.py serve
Serving on 0.0.0.0:8000   ## can see the Keras-io webpage at 8000 port

If you are looking for keras installation,
you can use pip install keras or pip install tensorflow

Traceback (most recent call last):
File "C:\Users\suz\anaconda3\lib\sre_parse.py", line 1039, in parse_template
this = chr(ESCAPES[this][1])
KeyError: '\m'

The above error looks more related to Anaconda. Try it on different virtual environment without Anaconda package.

@pure-rgb
Copy link
Author

I am on windows 10. Do you think it's related to OS? I also create a new and fresh environment, but when I ran the following command, I just faced the above-mentioned error. It looks like the windows path

python autogen.py make

....
re.error: bad escape \m at position 11

I will try again with your approach.

@gadagashwini
Copy link
Contributor

gadagashwini commented Apr 18, 2022

@Suzan009,
It might depend on OS platform.
From the error its look like, Its failing to fetch required the path.
Did you try steps mentioned in above comment. Thanks!

@pure-rgb
Copy link
Author

pure-rgb commented Apr 19, 2022

@gadagashwini unfortunately no. I am still facing that issue. I am using windows 10. Python version 3.9 (also test on 3.7, 3.8). Not to mention, I even re-install windows itself just to get rid of this silly issue. No change :(

When I run the following script, it just gives the re package error, like below.

python autogen.py make

....
re.error: bad escape \m at position 11

Searching the error took me these type of SO questions: https://stackoverflow.com/questions/58328587/python-3-7-4-re-error-bad-escape-s-at-position-0

@gadagashwini
Copy link
Contributor

@Suzan009, I couldn’t reproduce the issue on MAC OS and Linux machine.
May i know, why are you trying to launch Keras-io website from locally. Thanks!

@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.

@mitul01
Copy link

mitul01 commented May 4, 2022

@Suzan009 I haven't tried personally setting up Keras-io in windows but I would suggest you to try using windows subsystem Linux (WSL) to setup Keras-io if you think it a windows OS issue. They have also provided the docker image and if you have docker installed in your system you can always use that which will help remove all the installation and setup headaches.

@pure-rgb
Copy link
Author

pure-rgb commented May 7, 2022

@mitul01 Even if I did use docker, I also need to run python autogen.py which would cause the same error.

Using WSL is a good suggestion, but I really don't need it for any other stuff. So, I'm not willing to do that unless it's necessary to do so.

@pure-rgb
Copy link
Author

pure-rgb commented May 7, 2022

@Suzan009, I couldn’t reproduce the issue on MAC OS and Linux machine. May i know, why are you trying to launch Keras-io website from locally. Thanks!

Just wanted to do a f*ng contribution in the code example. I would try another round to setup it up from fresh windows. If it goes well, fine. Otherwise, I'll close this issue.

@gadagashwini
Copy link
Contributor

@Suzan009,
Did you get a chance to build fresh Keras-io on Windows.Thanks!

@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.

@pure-rgb
Copy link
Author

@gadagashwini
Unfortunately no :(
The way you did here, what was your os? and python version? and pip list?

@pure-rgb
Copy link
Author

@mitul01 I tried to use WSL. But after running the following command

pip install -r requirements.txt

it gave

WARNING: The script pygmentize is installed in '/home/suz/.local/bin' which is not on PATH. consider adding this directory to path

Not sure what to do next, so I ignored that.

python autogen.py make

from sphinx.util.inspect import Signature
ImportError: cannot import name 'Signature' from 'sphinx.util.inspect' (/home/suz/.local/lib/python3.8/site-packages/sphinx/util/inspect.py)

@mitul01
Copy link

mitul01 commented May 24, 2022

@Suzan009
I googled the error you are getting and you may need to downgrade the sphinx library. There is also a open pr request to fix this issue currently

keras-team/keras-autodoc#92

@gadagashwini
Copy link
Contributor

Hi @Suzan009,
I tested on Mac OS
Please find pip list
pip list

tabulate                      0.8.9
tblib                         1.7.0
tenacity                      8.0.1
tensorboard                   2.8.0
tensorboard-data-server       0.6.1
tensorboard-plugin-wit        1.8.1
tensorflow                    2.8.0
tensorflow-datasets           4.0.1
tensorflow-estimator          2.8.0
tensorflow-gcs-config         2.8.0
tensorflow-hub                0.12.0
tensorflow-io-gcs-filesystem  0.26.0
tensorflow-metadata           1.8.0
tensorflow-probability        0.16.0
termcolor                     1.1.0
terminado                     0.13.3
testpath                      0.6.0
text-unidecode                1.3
textblob                      0.15.3
Theano-PyMC                   1.1.2
thinc                         7.4.0
threadpoolctl                 3.1.0
tifffile                      2021.11.2
tinycss2                      1.1.1
tomli                         2.0.1
toolz                         0.11.2
torch                         1.11.0+cu113
torchaudio                    0.11.0+cu113
torchsummary                  1.5.1
torchtext                     0.12.0
torchvision                   0.12.0+cu113
tornado                       5.1.1
tqdm                          4.64.0
traitlets                     5.1.1
tweepy                        3.10.0
typeguard                     2.7.1
typing_extensions             4.2.0
tzlocal                       1.5.1
uritemplate                   3.0.1
urllib3                       1.24.3
vega-datasets                 0.9.0
wasabi                        0.9.1
wcwidth                       0.2.5
webencodings                  0.5.1
Werkzeug                      1.0.1
wheel                         0.37.1
widgetsnbextension            3.6.0
wordcloud                     1.5.0
wrapt                         1.14.1
xarray                        0.20.2
xarray-einstats               0.2.2
xgboost                       0.90
xkit                          0.0.0
xlrd                          1.1.0
xlwt                          1.3.0
yellowbrick                   1.4
zict                          2.2.0
zipp                          3.8.0

@pure-rgb
Copy link
Author

pure-rgb commented Jun 2, 2022

give up contributing to keras-io.

@pure-rgb pure-rgb closed this as completed Jun 2, 2022
@google-ml-butler
Copy link

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

@satpalsr
Copy link

@mitul01 @gadagashwini Is it also not supposed to work on Colab?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:awaiting response from contributor type:support User is asking for help / asking an implementation question. Stackoverflow would be better suited.
Projects
None yet
Development

No branches or pull requests

5 participants