Jetson-inference library

hello
i’m trying to build jetson-inference from source on my tx2 using the following steps


but every time i run any example i get the following error
nvidia@nvidia:~/jetson-inference/python/examples$ ./imagenet-console.py
Traceback (most recent call last):
File “./imagenet-console.py”, line 24, in
import jetson.inference
ImportError: No module named jetson.inference
how can i fix it ?

Hi,

Have you cloned the python branch?

EDIT: please see dusty-nv’s post below

Thanks.

unfortunately i cloned the master branch . i will consider your solution but before that , should i do anything to prevent any conflicts between the already the python branch and the master branch ? how could i remove any results of the old build ?

also i’d like to use this library and the jetson.utils library to do a computer vision task but i have some questions .
first can i use this libraries with tensorflow models ?
does the jetson.utils library require any build steps ?

Hi @M_okashaa, the python branch is no longer necessary to use, the python functionality has been merged into master.

Firstly, did you do a sudo make install followed by sudo ldconfig?

Next, I suggest trying to run the program as python imagenet-console.py my_image.jpg and see if that helps. It can also be useful to start an interaction python interpreter with verbose option (python -v) and see if you can import jetson.inference from there.

It does use some TensorFlow models that have been converted to UFF, like SSD-Mobilenet and SSD-Inception from Aasta’s tool here: https://github.com/AastaNV/TRT_object_detection

Note that it does require conversion from TensorFlow frozen pb graph to TensorRT UFF (see here), and generally each type of model is explicitly supported in the jetson-inference code with the necessary pre/post-processing (e.g. RGBA->NCHW format conversion, mean pixel subtraction, interpretation/clustering of output bounding boxes, ect)

It is integrated into the jetson-inference build, so no it does not require any extra build steps.

it couldn’t be imported neither using python or python3
python :
Traceback (most recent call last):
File “imagenet-console.py”, line 24, in
import jetson.inference
ImportError: No module named jetson.inference

python3:

Traceback (most recent call last):
File “imagenet-console.py”, line 24, in
import jetson.inference
File “”, line 971, in _find_and_load
File “”, line 941, in _find_and_load_unlocked
File “”, line 219, in _call_with_frames_removed
File “”, line 971, in _find_and_load
File “”, line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘jetson’

Can you check if you have a directory on your system called /usr/lib/python2.7/dist-packages/jetson/inference? It should have an __init__.py file under it.

Also, what is the output if you start an interactive python interpreter with verbose mode enabled (python -v) and type in import jetson.inference?

there is no directory called inference in the above link . only GPIO and Utils and _ init _.py

also the output is:

import jetson.inference
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named jetson.inference

OK, did you do a sudo make install from your jetson-inference/build directory?

The sudo make install step will install those Python files. After running it, you should see them there.

this is the output of the sudo make install command :

CMake Error at utils/python/bindings_python_2.7/cmake_install.cmake:89 (file):
file INSTALL cannot find
“/home/nvidia/new/jetson-inference/utils/python/bindings/…/python/jetson”.
Call Stack (most recent call first):
utils/python/cmake_install.cmake:58 (include)
utils/cmake_install.cmake:229 (include)
cmake_install.cmake:128 (include)

Makefile:117: recipe for target ‘install’ failed
make: *** [install] Error 1

Hmm it seems like something is awry with your jetson-inference source tree. Could you try re-cloning from master, and see if you get the same error? Which version of JetPack are you running?

Had the same problem.

I did the install using SDKManager for JetPack4.3.

Then followed all the Hello AI World tutorial steps through Downloading Models

including $ sudo apt-get install libpython3-dev python3-numpy

Next created the my-recognition python and cpp programs.

The cpp worked correctly.

my-recognition.py polar_bear.jpg didn’t work

python or python2 my-recognition.py polar_bear.jpg does not work

python3 my-recognition.py polar_bear.jpg does work