Plus, question about TRT_object_detection dependencies.
Got an error as run pip3 install numpy pycuda --user
In file included from src/cpp/cuda.cpp:4:0:
src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory #include <cuda.h>
^~~~~~~~
compilation terminated.
error: command ‘aarch64-linux-gnu-gcc’ failed with exit status 1
It looks like your device doesn’t install all the required package. Ex. CUDA, cuDNN and TensorRT.
It’s recommended to check if you have installed the “components” part after reflashing the device from SDK manager first.
I actually used sdkmanager to re-install the whole agx Xavier system included deepstream.
However. I still got the error. (#20)
OSError: libnvinfer.so.5: cannot open shared object file: No such file or directory
~/TRT_object_detection$ python3 main.py
2020-04-20 18:58:05.406758: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudart.so.10.0
Traceback (most recent call last):
File “main.py”, line 18, in
ctypes.CDLL(“lib/libflattenconcat.so”)
File “/usr/lib/python3.6/ctypes/init.py”, line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: libnvinfer.so.5: cannot open shared object file: No such file or directory
libnvinfer.so.6 could be find in /usr/lib/aarch64-linux-gnu but not .so.5.
Would you share us which layer is not supported?
I assume you tested Keras_inception model.
With this model training, most of layers are using keras default layers.
The layers we can remove are as the below.
x = base_model.output
x = GlobalAveragePooling2D()(x)
x = Dense(1024, activation=‘relu’)(x)
predictions = Dense(2, activation=‘softmax’)(x)
model = Model(inputs=base_model.input, outputs=predictions)
The non-supported operation is call swich.
This is an operation-level layer which is added by Keras/TensorFlow based on their implementation.
AFAIK, this operation is generally used in the training stage.
So, it may be worthy to check if you can remove the non-necessary training node by turning off training phase before the serialization.
K.set_learning_phase(0)
Thanks.
In general, this is an auxiliary type training operation.
Thank you so much for your great support.
We could transfer our model to tensor RT already.
Sorry. We did not use learning phase OFF model but use a forzen model pb file instead.