Segmentation Fault (core dumped) occurs when YOLOX is converted to TensorRT

I tried to convert YOLOX-nano.pth model to TensorRT with Jetson nano developer kit but got a segmentation fault.
I tried the same on desktop successfully.

python3 -f /home/jetson/yolox_nano/YOLOX/exps/example/custom/ -c /home/jetson/yolox_nano/YOLOX/YOLOX_outputs/yolox_nano/best_ckpt.pth 
Jetson nano 4GB
JetPack4.6, Cuda10.2
CuDNN 8.2
OS: Ubuntu18.04LTS

I have checked all the previous raised questions, but all the solutions dont work.
By the way the issue is also raised here segmentation fault


Would you mind monitoring your device status with tegrastats first.
Especially to check if an out-of-memory error occurs.

$ sudo tegrastats


I did

RAM 2334/3956MB (lfb 3x4MB) SWAP 774/1978MB (cached 49MB) IRAM 0/252kB(lfb 252kB) CPU [21%@307,14%@307,23%@307,10%@307] EMC_FREQ 4%@1600 GR3D_FREQ 6%@537 APE 25 PLL@22C CPU@25C PMIC@50C GPU@22C AO@29.5C thermal@23.5C POM_5V_IN 2438/2911 POM_5V_GPU 121/157 POM_5V_CPU 365/704


Sorry for the late update.
It seems that the memory is enough when running the script.

Is there any concurrent memory access on your code?
Please noted that concurrent access of a GPU buffer is only supported on the dGPU system.


I tried this with Nano 2GB/4GB because it is similar to the problem I have been trying with JetBot JetPack 4.6/4.6.1 for the past month.
The result was that both Nano 2GB/4GB worked.

JetBot image: EDIT: Use 64GB SDCARD
2GB Nano: - Google Drive
4GB Nano: - Google Drive

Open the JupyterLab Terminal in your browser, just like JetBot.
Execute the following commands.

# Install YOLOX
cd ~/github
git clone
mv requirements.txt R.txt
touch requirements.txt

pip install -e .
pip install loguru
pip install thop
pip install tabulate
pip install pycocotools
pip install tqdm
# download pre-trained yolox_nano.pth model

# build engine
time python3 ./tools/ -f ./exps/default/ -c yolox_nano.pth 
ls YOLOX_outputs/yolox_nano/

# infer
python3 tools/ image -f ./exps/default/ --trt --save_result
# copy to the ~/Notebooks
cp -r ./YOLOX_outputs ~/Notebooks

This is the screen shot when it is executed.

Memory usage:

Output image:

I am now running Object Following on a JetBot 2GB/4GB and am really surprised at how well it works.

One special setting for this image is the ZRAM setting.

sudo bash -c 'echo "vm.vfs_cache_pressure=500" >> /etc/sysctl.conf'
sudo bash -c 'echo "vm.swappiness=100" >> /etc/sysctl.conf'
sudo bash -c 'echo "vm.dirty_background_ratio=1" >> /etc/sysctl.conf'
sudo bash -c 'echo "vm.dirty_ratio=50" >> /etc/sysctl.conf'
sudo reboot

And one more thing, I have built TensorRT 8.2.3 to install onnx_graphsurgeon-0.3.15.

Thanks for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.