tensorflow / tfjs

A WebGL accelerated JavaScript library for training and deploying ML models.
https://js.tensorflow.org
Apache License 2.0
18.34k stars 1.92k forks source link

tensorflowjs_wizard keeps asking to install PyInquirer #6165

Closed abhinavkgrd closed 2 years ago

abhinavkgrd commented 2 years ago

Hii, So, I have been trying to setup and run tensorflowjs convert wizard .I followed the readme documentation. But after successfull installation when i run the wizard. It outputs the following message

$ tensorflowjs_wizard
2022-02-17 14:03:03.183616: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2022-02-17 14:03:03.183700: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Please install PyInquirer using following command:
              pip install PyInquirer==1.0.3

I ran the pip install PyInquirer==1.0.3 command and got this output

$ pip install PyInquirer==1.0.3
Collecting PyInquirer==1.0.3
  Using cached PyInquirer-1.0.3-py3-none-any.whl
Requirement already satisfied: prompt-toolkit==1.0.14 in ./venv/lib/python3.10/site-packages (from PyInquirer==1.0.3) (1.0.14)
Requirement already satisfied: Pygments>=2.2.0 in ./venv/lib/python3.10/site-packages (from PyInquirer==1.0.3) (2.11.2)
Requirement already satisfied: regex>=2016.11.21 in ./venv/lib/python3.10/site-packages (from PyInquirer==1.0.3) (2022.1.18)
Requirement already satisfied: six>=1.9.0 in ./venv/lib/python3.10/site-packages (from prompt-toolkit==1.0.14->PyInquirer==1.0.3) (1.16.0)
Requirement already satisfied: wcwidth in ./venv/lib/python3.10/site-packages (from prompt-toolkit==1.0.14->PyInquirer==1.0.3) (0.2.5)
Installing collected packages: PyInquirer
Successfully installed PyInquirer-1.0.3

I checked my pip list to see if PyInquirer was there and indeed it was

$ pip list
Package                      Version
---------------------------- -------------------
absl-py                      1.0.0
astunparse                   1.6.3
cachetools                   5.0.0
certifi                      2021.10.8
charset-normalizer           2.0.12
distlib                      0.3.4
filelock                     3.5.1
flatbuffers                  2.0
gast                         0.5.3
google-auth                  2.6.0
google-auth-oauthlib         0.4.6
google-pasta                 0.2.0
grpcio                       1.43.0
h5py                         3.6.0
idna                         3.3
keras                        2.8.0
Keras-Preprocessing          1.1.2
libclang                     13.0.0
Markdown                     3.3.6
numpy                        1.22.2
oauthlib                     3.2.0
opt-einsum                   3.3.0
pip                          22.0.3
platformdirs                 2.5.0
prompt-toolkit               1.0.14
protobuf                     3.19.4
pyasn1                       0.4.8
pyasn1-modules               0.2.8
Pygments                     2.11.2
PyInquirer                   1.0.3    < ----------------------- here
regex                        2022.1.18
requests                     2.27.1
requests-oauthlib            1.3.1
rsa                          4.8
setuptools                   58.1.0
six                          1.16.0
tensorboard                  2.8.0
tensorboard-data-server      0.6.1
tensorboard-plugin-wit       1.8.1
tensorflow                   2.8.0
tensorflow-hub               0.12.0
tensorflow-io-gcs-filesystem 0.24.0
tensorflowjs                 3.13.0
termcolor                    1.1.0
tf-estimator-nightly         2.8.0.dev2021122109
typing_extensions            4.1.1
urllib3                      1.26.8
virtualenv                   20.13.1
wcwidth                      0.2.5
Werkzeug                     2.0.3
wheel                        0.37.1
wrapt                        1.13.3

But when i again try to run the wizard , it gives the same error.

Thanks in advance.

System Config

OS : Ubuntu 20.04 running under wsl2 python - 3.10.2 pip3 - 21.2.4

rthadur commented 2 years ago

I tried to run the same in colab and i was not facing the issue , please check here. https://colab.research.google.com/drive/1ALPm79fQ8cmbg39mt9zLUD3xWebF-qVo?usp=sharing

abhinavkgrd commented 2 years ago

I tried to run the same in colab and i was not facing the issue , please check here. https://colab.research.google.com/drive/1ALPm79fQ8cmbg39mt9zLUD3xWebF-qVo?usp=sharing

It says access denied when I open the link. I have sent a request with the email (abhinavk.grd@gmail.com).

can you please accept it?

Thank you

abhinavkgrd commented 2 years ago

Thanks, @rthadur for pointing me in the right direction. google colab did the job 😄

I followed this blog https://blog.tensorflow.org/2018/07/train-model-in-tfkeras-with-colab-and-run-in-browser-tensorflowjs.html

and used the commands on this doc https://www.tensorflow.org/js/tutorials/conversion/import_saved_model to convert a tf_hub model.

and it all ran smoothly

rthadur commented 2 years ago

Thank you !

alexandernst commented 1 year ago

Why was this closed? I can repro this bug

abhinavkgrd commented 1 year ago

Why was this closed? I can repro this bug

Yes. But the using colab is much easier and better way of doing it.

Hence solving my problem. No need locally installing dependencies

alexandernst commented 1 year ago

Sure, you got a workaround, but the bug still exists and other users might want it to be fixed :/

abhinavkgrd commented 1 year ago

😬 @rthadur, can you help him?

edoardogiacomello commented 1 year ago

I'm having this issue as well. On another machine I managed to make it work after several retries, but couldn't figure out how. Now I'm on a different machine and I couldn't make it work, I also created a dedicated venv, with no success.

The problem is that if you are using python notebooks then PyInquirer gets updated by ipykernel and its stack so the two cannot coexist on the same environment...

P.S.: Github Issues is not Yahoo Answers, as long as the bug is present the issue should be open, no matter if who raises the problem has found another way...

pyu10055 commented 1 year ago

@edoardogiacomello @alexandernst Sadly, PyInquirer is not maintained, and it is having conflicts with other package. We will need to replace the usage with another CLI system to fix this issue. Meanwhile you can use tensorflowjs_converter to achieve the same functionalities.