Search code examples
tensorflowtensorrtnvidia-jetson-nano

Tensorflow, TRT models installation problem


I installed tf_trt_models on Jetson-nano following the instructions here. I am getting the following error

Installed /home/tarik-dev/.local/lib/python3.6/site-packages/slim-0.1-py3.6.egg
Processing dependencies for slim==0.1
Finished processing dependencies for slim==0.1
~/tf_trt_models
Installing tf_trt_models
/home/tarik-dev/tf_trt_models
running install
Checking .pth file support in /home/tarik-dev/.local/lib/python3.6/site-packages/
/home/tarik-dev/.virtualenvs/nanocv/bin/python -E -c pass
TEST FAILED: /home/tarik-dev/.local/lib/python3.6/site-packages/ does NOT support .pth files
bad install directory or PYTHONPATH

Solution

  • Found the solution. In the install script, because I am in virtualenv, I will need to remove --user Here is the install.sh script

    #!/bin/bash
    
    INSTALL_PROTOC=$PWD/scripts/install_protoc.sh
    MODELS_DIR=$PWD/third_party/models
    
    PYTHON=python
    
    if [ $# -eq 1 ]; then
      PYTHON=$1
    fi
    
    echo $PYTHON
    
    # install protoc
    echo "Downloading protoc"
    source $INSTALL_PROTOC
    PROTOC=$PWD/data/protoc/bin/protoc
    
    # install tensorflow models
    git submodule update --init
    
    pushd $MODELS_DIR/research
    echo $PWD
    echo "Installing object detection library"
    echo $PROTOC
    $PROTOC object_detection/protos/*.proto --python_out=.
    $PYTHON setup.py install --user
    popd
    
    pushd $MODELS_DIR/research/slim
    echo $PWD
    echo "Installing slim library"
    $PYTHON setup.py install --user
    popd
    
    echo "Installing tf_trt_models"
    echo $PWD
    $PYTHON setup.py install --user