Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6392 Discussions

Issue with running model_optimizer install_prerequisites_tf2.sh

Daneto96
Novice
2,328 Views

Hi everybody! I want to use the Openvino_2021 model_optimizer with a .pb file that i created with Tensorflow 2. I get a error when  running the install_prerequisites_tf2.sh file. I followed the requirements in the "requirements_tf2.txt" file and installed tensorflow(Version2.2), networkx, numpy, test-generator and defusedxml in my conda environment

How can i solve this issue? Thanks for your help

(tensorflow2) daniel@daniel-desktop:/opt/intel/openvino_2021/deployment_tools/model_optimizer/install_prerequisites$ ./install_prerequisites_tf2.sh
[sudo] password for daniel:
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:2 http://de.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://de.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [49.0 kB]
Get:6 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [58.8 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2464 B]
Fetched 199 kB in 1s (223 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
20 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgfortran5 is already the newest version (8.4.0-1ubuntu1~18.04).
python3-pip is already the newest version (9.0.1-2.3~ubuntu1.18.04.4).
python3-venv is already the newest version (3.6.7-1~18.04).
The following packages were automatically installed and are no longer required:
libfwup1 libllvm9 linux-hwe-5.4-headers-5.4.0-45
linux-hwe-5.4-headers-5.4.0-47
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
The directory '/home/daniel/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/daniel/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting tensorflow>=2.0 (from -r /opt/intel/openvino_2021/deployment_tools/model_optimizer/install_prerequisites/../requirements_tf2.txt (line 1))
Could not find a version that satisfies the requirement tensorflow>=2.0 (from -r /opt/intel/openvino_2021/deployment_tools/model_optimizer/install_prerequisites/../requirements_tf2.txt (line 1)) (from versions: 0.12.1, 1.0.0, 1.0.1, 1.1.0rc0, 1.1.0rc1, 1.1.0rc2, 1.1.0, 1.2.0rc0, 1.2.0rc1, 1.2.0rc2, 1.2.0, 1.2.1, 1.3.0rc0, 1.3.0rc1, 1.3.0rc2, 1.3.0, 1.4.0rc0, 1.4.0rc1, 1.4.0, 1.4.1, 1.5.0rc0, 1.5.0rc1, 1.5.0, 1.5.1, 1.6.0rc0, 1.6.0rc1, 1.6.0, 1.7.0rc0, 1.7.0rc1, 1.7.0, 1.7.1, 1.8.0rc0, 1.8.0rc1, 1.8.0, 1.9.0rc0, 1.9.0rc1, 1.9.0rc2, 1.9.0, 1.10.0rc0, 1.10.0rc1, 1.10.0, 1.10.1, 1.11.0rc0, 1.11.0rc1, 1.11.0rc2, 1.11.0, 1.12.0rc0, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.12.2, 1.12.3, 1.13.0rc0, 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 2.0.0a0, 2.0.0b0, 2.0.0b1)
No matching distribution found for tensorflow>=2.0 (from -r /opt/intel/openvino_2021/deployment_tools/model_optimizer/install_prerequisites/../requirements_tf2.txt (line 1))
Error on or near line 92; exiting with status 1

Labels (1)
0 Kudos
7 Replies
Iffa_Intel
Moderator
2,292 Views

Greetings,


Did you tried to install Tensorflow 2.0 in your system manually?

sudo -h pip3 install tensorflow==2.0


Install this manually and try to run the installation script again.


Sincerely,

Iffa




0 Kudos
Daneto96
Novice
2,285 Views

Hi.

Thanks for your answer!

I did install it manually. To test your suggestion I uninstalled tensorflow first. Then i tried it with "sudo -h pip3 install tensorflow==2.0" but it didn't work (Screenshot1). Then i tried "sudo pip3 install tensorflow==2.0" without the -h flag - This gave me a warning "Could not find a version that satisfies the requirement tensorflow==2.0" (Screenshot2). After that i tried "sudo pip3 install tensorflow==2.0.0b1" -> This was successful as you can see in Screenshot3.   I then tried to run install_prerequisites_tf2.sh again but i got the same error again (See Screenshots 4+5).

In a different environment I installed tensorflow 2.3.1, but this does also not work with install_prerequisites

Please give me advice on what to do, i really need this to work.

Kind regards Daniel

0 Kudos
Iffa_Intel
Moderator
2,269 Views

As of October 2020:

  • Tensorflow only supports the 64-bit version of Python
  • Tensorflow only supports Python 3.5 to 3.8

So, if you're using an older version of Python or a 32-bit version, then you'll need to use a different version.


Plus this might be useful for you: https://appuals.com/could-not-find-a-version-that-satisfies-the-requirement-for-tensorflow/


As for now I'm using Python 3.6 and it works with Tensorflow 2.


Sincerely,

Iffa


0 Kudos
Daneto96
Novice
2,260 Views

Hi.

Thank your for your answer and the link you sent me.

I can confirm that i have 64-bit Version installed and i have Python 3.7 - so it really should work - but sadly it doesn't.

I tried again today with a different PC and there i could run the "install_prerequisites_tf2.sh" file without a error. So i can work with this solution for now.

Very strange that it doesn't work on my main PC since my approach didn't change.

Kind regards Daniel

Iffa_Intel
Moderator
2,244 Views

The unable to resolve host in linux usually happens after host-name changed. (https://www.youtube.com/watch?v=cvazO6i0i5s)


pip could also be the the reason as what these users had been facing: https://github.com/tensorflow/tensorflow/issues/31939


Sincerely,

Iffa


0 Kudos
Iffa_Intel
Moderator
2,228 Views

Greetings,


Intel will no longer monitor this thread since we have provided a solution. If you need any additional information from Intel, please submit a new question


Sincerely,

Iffa


0 Kudos
Jenny_X
Beginner
1,619 Views

Hello , everyone! I want to installing Model Optimizer Pre-Requisites  in the raspberry pi, according to Installing Model Optimizer Pre-Requisites - OpenVINO™ Toolkit.

However, when I comes to " ./install_prerequisites.sh " , it just shows that 

pi@raspberrypi:~/Downloads/OpenVINO/l_openvino_toolkit_runtime_raspbian_p_2020.4.287/deployment_tools/model_optimizer/install_prerequisites $ sudo ./install_prerequisites.sh
sudo: 不适用的选项 -- m
usage: sudo -h | -K | -k | -V
usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]
[command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] file ...
Error on or near line 92; exiting with status 1

 I have tried to change ' install_prerequisites.sh '  in the /home/pi/Downloads/OpenVINO/l_openvino_toolkit_runtime_raspbian_p_2020.4.287/deployment_tools/model_optimizer/install_prerequisites ' , it doesn't work , either .

 

0 Kudos
Reply