Introduction
This tutorial will work as a guide for when you want to install Deep View Converter in a fresh Python environment. These packages are all published on the PyPi repository and can be installed via the standard PIP installation process.
Prerequisites
- Python 3.8 or newer installed
- virtualenv package installed (pip install virtualenv)
Setup
For this guide we will be working with a fresh python environment. To create a new python environment, you will run the command
python -m venv env_name
This will create a folder of the name provided for env_name that contains the base python installation that is used by your computer's environment.
To activate this environment in Windows:
(Windows) C:\> $env_name\Scripts\activate
and in Linux:
(Linux) $ source $env_name\Scripts\activate
The next steps are to install the Deep View packages:
python -m pip install deepview-converter
python -m pip install deepview-converter-rtm
python -m pip install deepview-converter-tflite
This will provide you access to the converter as well as all plugins (RT, TFLite) from within your python environment and allow you use of the deepview-converter command. All plugin installs are optional if they are not needed.
Conversion to RTM supports Keras (.h5), TFLite (.tflite) and ONNX (.onnx) as input file formats.
Conversion to TFLite supports Keras (.h5) and ONNX (.onnx) as input file formats.
Now you need to provide the converter with the Deep View RT library. Currently you need to manually set this. First go to the Deep View RT Downloads Page and download the newest version of Deep View RT zip or .tar.gz) for your environment
Using WinRar, 7Zip, or some other extraction method, extract the zipped file to a folder.
Windows (Command Prompt)
For Windows, you will need to provide the .dll file from within that folder. That can be done with the following commands:
cd extracted_folder\bin
set "DEEPVIEW_RT=%CD%\DeepViewRT.dll"
echo %DEEPVIEW_RT%
The echo command should output the correct file and location.
Windows (PowerShell)
For Windows, you will need to provide the .dll file from within that folder. That can be done with the following commands:
cd extracted_folder\bin
$env:DEEPVIEW_RT="$PWD\DeepViewRT.dll"
echo $env:DEEPVIEW_RT
The echo command should output the correct file and location.
Linux
For Linux, you will need to provide the .so file from with that zipped tarball. That can be done with the following commands.
tar xzvf deepview-rt-latest-linux-x64_64.tar.gz
cd lib
export DEEPVIEW_RT=$(pwd)/libdeepview-rt.so
echo $DEEPVIEW_RT
The echo command should output the correct file and location.
Confirmation that installation of all elements can be done with the --help and --list options:
(pypi_testing) Q:\pypi>deepview-converter --help
deepview-converter 2.6.0
usage: deepview-converter [options]
options:
[-h] [--help] [plugin_name source_type dest_type] Prints this help for a plugin or this help
[-v] [--version] Prints version
[-r] [--reserve] Prints Reserved Params List
[-l] [--list] Lists installed plugins
[-i] [--install] path_to_whl_file Installs a plugin
[-u] [--uninstall] plugin_name Uninstalls a plugin
[--source] source_model [--dest] destination_model [conveter specific parameters] Converts a model
(pypi_testing) Q:\pypi>deepview-converter --list
deepview-converter 2.6.0
--------------- deepview-converter-tflite ---------------
name: deepview-converter-tflite
sanityCheck: ok
summary: DeepView Converter for TensorFlow Lite
author: Au-Zone
version: 2.5.20
inputsSupported: [{'ext': 'h5', 'name': 'Keras'}, {'ext': 'pb', 'name': 'Tensorflow'}, {'ext': 'onnx', 'name': 'ONNX'}, {'ext': 'http', 'name': 'Web Hosted Model'}]
outputsSupported: [{'ext': 'tflite', 'name': 'Tensorflow Lite'}]
path: q:\pypi\pypi_testing\lib\site-packages\deepview_tensorflow\__main__.py
--------------- deepview-converter-rtm ---------------
name: deepview-converter-rtm
sanityCheck: ok
summary: DeepView Converter for DeepViewRT
author: Au-Zone
version: 2.5.25
inputsSupported: [{'ext': 'h5', 'name': 'Keras'}, {'ext': 'pb', 'name': 'Tensorflow'}, {'ext': 'onnx', 'name': 'ONNX'}, {'ext': 'tflite', 'name': 'Tensorflow Lite'}]
outputsSupported: [{'ext': 'rtm', 'name': 'Deepview RT'}]
path: q:\pypi\pypi_testing\lib\site-packages\deepview_rtm\__main__.py
Congratulations! Your python environment is set up for use with the Deep View Converter, please check out some of our other awesome guides for how to effectively use the Deep View Converter.
Comments
0 comments
Please sign in to leave a comment.