Open zhr01 opened 3 years ago
Could you share the commands you've run so far, as well as the output of running python3 scripts/get_system_id.py
from the closed/NVIDIA directory? Thanks
The python3-libnvinfer only works with python3.6. There are some discussion here: https://forums.developer.nvidia.com/t/python-binding-not-found-for-tensorrt/76408.
It looks like the python3.8 binding needed to created with manual binding
Hi @zhr01 , have you solved the problem?
I followed the instruction to set up the environment for testing on Jetson AGX Xavier, everything went fine for running the script install_xavier_dependencies.sh
, but when I ran the script for data preprocessing, error occurred that:
No module named 'tensorrt'
I noticed that in 'install_xavier_dependencies.sh' python3.8 was installed and set as the default version of python3, but python3.8 could not import 'tensorrt'. I tried to "import tensorrt" with python3.6 and no error occurred.
So @nvitramble , do I miss something in the official instruction? Should I manually compile & build the .whl for using tensorrt with python3.8?
What's more, I check the instruction of build the python binding, and find that I can not find the 'PyConfig.h' file for python3.8 (on aarch64) according to the link NVIDIA provided in this section 'Add PyConfig.h'. How can I build the binding for python3.8?
@Treemann It looks like we are banging our heads against the same wall and at the same time!
FWIW, I've tried to take pyconfig.h
from a non-architecture specific python3.8 package and an aarch-specific python3.9 package, but nothing's worked.
/cc @nvpohanh @DilipSequeira
Hi @psyhtest I could find the 'PyConfig.h' on the location where Python3.8 was installed. I built the 'python binding' for Python3.8 successfully and finally could run the script for testing. (FYI: I tried with the code for MLPerf v1.1)
@Treemann, that's great to hear! I was beginning to suspect that something else was wrong. I'll give it another try.
@yzh89 Please try these instructions (copying and pasting the whole block should work).
@psyhtest well done. But followed by a segfault on "reate_network" as blow: script
import numpy as np
def pyBuilder(framework):
if framework=="trt":
import tensorrt as rt
logger=rt.Logger(rt.Logger.WARNING)
with rt.Builder(logger) as builder:
print("--------------------------------------")
with builder.create_network(1 << int(rt.NetworkDefinitionCreationFlag.EXPLICIT_BATCH)) as network:
print("--------------------------------------")
INPUT_NAME="input"
INPUT_SHAPE=(3,5,5)
input_tensor = network.add_input(name=INPUT_NAME, dtype=rt.float32, shape=INPUT_SHAPE)
conv1_w = np.random.random(size=(3,3,5))
conv1_w.dtype = "float32"
conv1_b = np.random.random(size=(3))
conv1_b.dtype = "float32"
conv1 = network.add_convolution(input=input_tensor, num_output_maps=20, kernel_shape=(5, 5), kernel=conv1_w, bias=conv1_b)
conv1.stride = (1, 1)
print(type(conv1))
print(dir(conv1))
print(conv1.kernel_size)
conv1.kernel_size=(7,7)
print(conv1.kernel_size)
print(conv1.num_output_maps)
print(conv1.stride)
print(conv1.padding)
print(conv1.num_output_maps)
print(conv1.num_groups)
conv1.num_groups=21
print(conv1.get_input(0))
print(dir(conv1.get_input(0)))
print(conv1.get_input(1))
print(conv1.get_input(-1))
pyBuilder("trt")
output
load lib: /usr/local/lib/python3.8/dist-packages/tensorrt/tensorrt.so
8.2.5.1
--------------------------------------
Segmentation fault
May caused by the mismatch between tensorrt python API and tensorrt.so?
I try to achive the result in Nvidia Jetson Xavier NX. After setup up the environment, I got the fllowing error message:
then I check the environment, found the tensorrt not in my python3.8 env, so how can I install tensorrt for python3.8