ImportError: No module named caffe

I am following the image segmentation tutorial https://github.com/dusty-nv/jetson-inference/blob/master/docs/segnet-pretrained.md to download the model to Jetson Xavier.

I am facing the following error,

./net_surgery.py
Traceback (most recent call last):
  File "./net_surgery.py", line 9, in <module>
    import caffe
ImportError: No module named caffe

Did anyone face similar issue?

Thanks in advance.

1 Like

Hi,

net_surgery.py is a script used for training. You will need an x86 environment to apply for training.
After getting the pretrained model, please copy the model into Jetson and refers to this section to run it with TensorRT:
https://github.com/dusty-nv/jetson-inference/blob/master/docs/segnet-console.md

Thanks.

Hello,

Thank you for your reply.

I am trying to train the model in the host x86. To create a new segmentaion model I am trying to generate a pretrained model (fcn_alexnet.caffemodel) using ./net_surgery.py as mentioned in the article, https://github.com/dusty-nv/jetson-inference/blob/master/docs/segnet-pretrained.md

and facing the before mentioned error with that.

THanks

Hi,

It looks like Caffe is missing on your x86 device.
Please follow this tutorial to setup the DIGITs first:
https://github.com/NVIDIA/DIGITS/blob/master/docs/BuildDigits.md

Thanks.

1 Like

still doesn’t work!

Hi, chenterry968

Would you mind to share which error do you meet with us?

To install Caffe on Xavier, here is a relevant topic for your reference first:
https://devtalk.nvidia.com/default/topic/1044473/jetson-agx-xavier/caffe-installation-on-xavier/

You will also need to add the building folder into the python path.

export PYTHONPATH=~/caffe/python/:$PYTHONPATH

Thanks.

1 Like