Jetracer road_following error, "name '_C' is not defined"

Hey all, I’m struggling with my Jetracer at the road_following step. I’ve successfully trained the visual model using the intergrated_regression notebook and I have saved that model. However, when I go to do anything with road_following.ipynb, I hit a wall.

Every time I start any of the code segments in this section, I get the NameError: name ‘_C’ is not defined. I’ve only included the first chunk of code, but I get it for almost every section of code. I can give screenshots of the other errors if needed, but this block seems the most important for the rest of the page to get working.

None of this sheet works because I can’t define the “model” or “model_trt” variables that the whole page depends on. I’ve googled for hours and haven’t found anything helpful. I’ve already tried upgrading torch, activating the code in different orders, added “import cv2” in multiple places, turned it off and then turned it back on again, burned some sage, splashed some holy water on it… nothing. Any help with this issue would be greatly appreciated. Thank you!

Hello @rswhitedvm,

Welcome to the Isaac ROS forum, and thanks for your post!
Since import torch already fails, anything depending on PyTorch, like torchvision or model definitions etc. will also fail, which matches the issue you’re seeing in your notebook.

This suggests PyTorch may not be correctly installed in your environment. Try running the following in a Jupyter notebook cell:
import torch print(torch.__version__) print(torch.cuda.is_available())

If this fails or you see errors about _C or missing libtorch_*.so, your PyTorch installation is likely broken. In that case, uninstall PyTorch and reinstall the NVIDIA-provided wheel appropriate for your JetPack version.*
If you are using the official JetRacer or JetBot SD image, you could also try reflashing the image to ensure a clean environment.