Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
277 Views

Tensorflow to IR convertion

There is .pb file with tf model. It needs to convert him to IR format.

I run the command (in admin-privilegies terminal):

mo_tf.py --input_model final_combined_alpha0.5_weights.pb

And it returns an error:

[ ERROR ]
Detected not satisfied dependencies:
        tensorflow: not installed, required: 1.2.0

Please install required versions of components or use install_prerequisites script
C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\install_prerequisites\install_prerequisites_tf.bat
Note that install_prerequisites scripts may install additional components.

Earlier I run install_prerequisites\install_prerequisites_tf.bat. I try it run secondary, and it notify, that all components are installed:

C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\install_prerequisites>install_prerequisites_tf.bat
Python 3.7.3
ECHO is off.
Requirement already satisfied: tensorflow<2.0.0,>=1.2.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from -r ..\requirements_tf.txt (line 1)) (1.14.0)
Requirement already satisfied: networkx>=1.11 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from -r ..\requirements_tf.txt (line 2)) (2.3)
Requirement already satisfied: numpy>=1.12.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from -r ..\requirements_tf.txt (line 3)) (1.16.4)
Requirement already satisfied: test-generator==0.1.1 in c:\users\pveryovkin\appdata\roaming\python\python37\site-packages (from -r ..\requirements_tf.txt (line 4)) (0.1.1)
Requirement already satisfied: defusedxml>=0.5.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from -r ..\requirements_tf.txt (line 5)) (0.6.0)
Requirement already satisfied: protobuf>=3.6.1 in c:\users\pveryovkin\appdata\roaming\python\python37\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (3.6.1)
Requirement already satisfied: astor>=0.6.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (0.8.0)
Requirement already satisfied: keras-applications>=1.0.6 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (1.0.8)
Requirement already satisfied: google-pasta>=0.1.6 in c:\users\pveryovkin\appdata\roaming\python\python37\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (0.1.7)
Requirement already satisfied: termcolor>=1.1.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (1.1.0)
Requirement already satisfied: grpcio>=1.8.6 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (1.16.1)
Requirement already satisfied: wheel>=0.26 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (0.33.4)
Requirement already satisfied: absl-py>=0.7.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (0.7.1)
Requirement already satisfied: tensorflow-estimator<1.15.0rc0,>=1.14.0rc0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (1.14.0)
Requirement already satisfied: six>=1.10.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (1.12.0)
Requirement already satisfied: keras-preprocessing>=1.0.5 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (1.1.0)
Requirement already satisfied: wrapt>=1.11.1 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (1.11.2)
Requirement already satisfied: gast>=0.2.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (0.2.2)
Requirement already satisfied: tensorboard<1.15.0,>=1.14.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (1.14.0)
Requirement already satisfied: decorator>=4.3.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from networkx>=1.11->-r ..\requirements_tf.txt (line 2)) (4.4.0)
Requirement already satisfied: setuptools in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from protobuf>=3.6.1->tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (41.0.1)
Requirement already satisfied: h5py in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from keras-applications>=1.0.6->tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (2.9.0)
Requirement already satisfied: markdown>=2.6.8 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (3.1.1)
Requirement already satisfied: werkzeug>=0.11.15 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow<2.0.0,>=1.2.0->-r ..\requirements_tf.txt (line 1)) (0.15.4)
*****************************************************************************************
Warning: please expect that Model Optimizer conversion might be slow.
You can boost conversion speed by installing protobuf-*.egg located in the
"model-optimizer\install_prerequisites" folder or building protobuf library from sources.
For more information please refer to Model Optimizer FAQ, question #80.

I try run "pip install tensorflow", it also notify, that tf is installed:

PS C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\install_prerequisites> pip install tensorflow
Requirement already satisfied: tensorflow in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (1.14.0)
Requirement already satisfied: termcolor>=1.1.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: grpcio>=1.8.6 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.16.1)
Requirement already satisfied: keras-preprocessing>=1.0.5 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.1.0)
Requirement already satisfied: keras-applications>=1.0.6 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.0.8)
Requirement already satisfied: astor>=0.6.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (0.8.0)
Requirement already satisfied: google-pasta>=0.1.6 in c:\users\pveryovkin\appdata\roaming\python\python37\site-packages (from tensorflow) (0.1.7)
Requirement already satisfied: wheel>=0.26 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (0.33.4)
Requirement already satisfied: numpy<2.0,>=1.14.5 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.16.4)
Requirement already satisfied: wrapt>=1.11.1 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.11.2)
Requirement already satisfied: protobuf>=3.6.1 in c:\users\pveryovkin\appdata\roaming\python\python37\site-packages (from tensorflow) (3.6.1)
Requirement already satisfied: six>=1.10.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.12.0)
Requirement already satisfied: absl-py>=0.7.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (0.7.1)
Requirement already satisfied: tensorboard<1.15.0,>=1.14.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.14.0)
Requirement already satisfied: tensorflow-estimator<1.15.0rc0,>=1.14.0rc0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (1.14.0)
Requirement already satisfied: gast>=0.2.0 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorflow) (0.2.2)
Requirement already satisfied: h5py in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from keras-applications>=1.0.6->tensorflow) (2.9.0)
Requirement already satisfied: setuptools in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from protobuf>=3.6.1->tensorflow) (41.0.1)
Requirement already satisfied: markdown>=2.6.8 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow) (3.1.1)
Requirement already satisfied: werkzeug>=0.11.15 in c:\users\pveryovkin\appdata\local\continuum\anaconda3\lib\site-packages (from tensorboard<1.15.0,>=1.14.0->tensorflow) (0.15.4)

Where is my fail?

 

0 Kudos
9 Replies
Highlighted
277 Views

Hi could you try to run this in the terminal 

pip install --upgrade tensorflow==1.2 .0

it could be that your model has a hard requirement on that version.

0 Kudos
Highlighted
277 Views

It returns an error:

PS C:\WINDOWS\system32> pip install --upgrade tensorflow==1.2.0
Collecting tensorflow==1.2.0
  ERROR: Could not find a version that satisfies the requirement tensorflow==1.2.0 (from versions: 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.13.2, 1.14.0rc0, 1.14.0rc1, 1.14.0, 1.15.0rc0, 1.15.0rc1, 2.0.0a0, 2.0.0b0, 2.0.0b1, 2.0.0rc0, 2.0.0rc1)
ERROR: No matching distribution found for tensorflow==1.2.0

 

 

0 Kudos
Highlighted
277 Views

Hi Zabeth,

For the latest wheel from Tensorflow site, you can try something like -

python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.14.0-cp37-cp37m-linux_x86_64.whl

For python 3.7x, if no pip install works, try downgrading to python 3.6

0 Kudos
Highlighted
277 Views

This link is for linux, I try for windows:

pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.14.0-cp37-cp37m-windows_x86_64.wh...

And this returns an error:

ERROR: tensorflow-1.14.0-cp37-cp37m-windows_x86_64.whl is not a supported wheel on this platform.

 

0 Kudos
Highlighted
Employee
277 Views

Dear Zabeth -cp37 means Python 3.7 so you likely don't have Python 3.7 on your machine. Also windows_x86_64 means 64-bit OS, which if you're using the supported Windows OS for OpenVino (Windows 10), should be OK.

Thanks,

Shubha

 

0 Kudos
Highlighted
277 Views

I installed Python 3.7 (and added it to PATH) . OS is Windows 10 64bit, but this error appears again.

 

0 Kudos
Highlighted
277 Views

I found temporary solution of the problem - renamed folder with anaconda3 to "anaconda3.BAK". Then pip didn't found tensorflow library (it was installed as part of anaconda) and installed it again, but as part of Python 3.7 . Then optimizer script succesfully run. But it fails with another problem (it will be new forum topic).

I hope you will create method for overcoming of this problem by regularly method, without dirty tricks with renaming of anaconda :) 

 

0 Kudos
Highlighted
Employee
277 Views

Dear Corvid, Zabeth,

I'm super glad you found a workaround. But honestly Model Optimizer works just fine within Anaconda. So do all of the OpenVino Python based tools. 

My feeling is that somehow your Python environment is messed up. I have also been in this situation (messed up Python environment). What I do is pretty much uninstall all the versions of Python I have except for Anaconda. I also delete various unused site-packages directories laying around after formal Python un-installation. Model Optimizer doesn't care whether Python came from a standalone Python installation or from Anaconda.

Hope it helps,

Thanks,

Shubha

0 Kudos
Highlighted
Beginner
206 Views

I totally agree with the intel employee.

This kind of error occurs when your Python development environment is not set up correctly.

If you are working with pip then upgrade pip to latest version which is pip3.

That is why we have to use virtualenv or pipenv or venv to separate the project dependencies.

The isolated environment is very useful when every coding stack demands different types of dependencies.

Next time, please do think about the virtual environment in your system.

KDL
0 Kudos