Faster R-CNN on Jetson TX1

Hello All;
Please, is there any steps to install Faster R-CNN on jetson TX1 I tried to follow Bellow steps but there a lot error in make.
is any website or steps you Guys recommended to me.
Thanks

https://devtalk.nvidia.com/default/topic/974063/jetson-tx1/caffe-failed-with-py-faster-rcnn-demo-py-on-tx1/

Unforntuantly I have not made a guide, but I have done it. Running VGG16 it is 2 seconds per frame, and you must reboot between runs to purge the RAM.

Hi,

Thanks for your question.

We have verified the steps you mentioned. It should work.
We will try the procedures again and let you know the results.

Hi,

Just confirm that faster-rcnn can be successfully installed on jetson tx1.
We simply the installation steps here, could you try it again?

1. dependency:

sudo apt-get install libboost-dev libboost-all-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev libatlas-base-dev liblmdb-dev libblas-dev libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install python-numpy cython python-pip python-opencv libfreetype6-dev libv4l-dev xorg python-protobuf python-dev libffi-dev language-pack-id
sudo apt-get install language-pack-id
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales
sudo pip install --upgrade pip
sudo pip install easydict pyyaml scikit-image

2. caffe:

git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
cd /home/ubuntu/py-faster-rcnn/caffe-fast-rcnn

Apply this:

diff --git a/Makefile b/Makefile
index 598d28d..90000b2 100644
--- a/Makefile
+++ b/Makefile
@@ -178,7 +178,7 @@ ifneq ($(CPU_ONLY), 1)
 	LIBRARIES := cudart cublas curand
 endif
 
-LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
+LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial
 
 # handle IO dependencies
 USE_LEVELDB ?= 1
diff --git a/Makefile.config.example b/Makefile.config.example
index 8fd49c9..dc2cd69 100644
--- a/Makefile.config.example
+++ b/Makefile.config.example
@@ -2,7 +2,7 @@
 # Contributions simplifying and improving our build system are welcome!
 
 # cuDNN acceleration switch (uncomment to build with cuDNN).
-# USE_CUDNN := 1
+USE_CUDNN := 1
 
 # CPU-only switch (uncomment to build without GPU support).
 # CPU_ONLY := 1
@@ -84,10 +84,10 @@ PYTHON_LIB := /usr/lib
 # PYTHON_LIB += $(shell brew --prefix numpy)/lib
 
 # Uncomment to support layers written in Python (will link against Python libs)
-# WITH_PYTHON_LAYER := 1
+WITH_PYTHON_LAYER := 1
 
 # Whatever else you find you need goes here.
-INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
+INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
 LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
 
 # If Homebrew is installed at a non standard location (for example your home directory) and you use it for general dependencies
diff --git a/include/caffe/layers/cudnn_relu_layer.hpp b/include/caffe/layers/cudnn_relu_layer.hpp
index e01f568..a1cb29e 100644
--- a/include/caffe/layers/cudnn_relu_layer.hpp
+++ b/include/caffe/layers/cudnn_relu_layer.hpp
@@ -37,6 +37,7 @@ class CuDNNReLULayer : public ReLULayer<Dtype> {
   cudnnHandle_t             handle_;
   cudnnTensorDescriptor_t bottom_desc_;
   cudnnTensorDescriptor_t top_desc_;
+  cudnnActivationDescriptor_t activ_desc_;
 };
 #endif
 
diff --git a/include/caffe/layers/cudnn_sigmoid_layer.hpp b/include/caffe/layers/cudnn_sigmoid_layer.hpp
index 9c59795..7b3486f 100644
--- a/include/caffe/layers/cudnn_sigmoid_layer.hpp
+++ b/include/caffe/layers/cudnn_sigmoid_layer.hpp
@@ -37,6 +37,7 @@ class CuDNNSigmoidLayer : public SigmoidLayer<Dtype> {
   cudnnHandle_t             handle_;
   cudnnTensorDescriptor_t bottom_desc_;
   cudnnTensorDescriptor_t top_desc_;
+  cudnnActivationDescriptor_t activ_desc_;
 };
 #endif
 
diff --git a/include/caffe/layers/cudnn_tanh_layer.hpp b/include/caffe/layers/cudnn_tanh_layer.hpp
index c0f0053..59e758d 100644
--- a/include/caffe/layers/cudnn_tanh_layer.hpp
+++ b/include/caffe/layers/cudnn_tanh_layer.hpp
@@ -37,6 +37,7 @@ class CuDNNTanHLayer : public TanHLayer<Dtype> {
   cudnnHandle_t             handle_;
   cudnnTensorDescriptor_t bottom_desc_;
   cudnnTensorDescriptor_t top_desc_;
+  cudnnActivationDescriptor_t activ_desc_;
 };
 #endif
 
diff --git a/include/caffe/util/cudnn.hpp b/include/caffe/util/cudnn.hpp
index 8a7e17c..498cfe3 100644
--- a/include/caffe/util/cudnn.hpp
+++ b/include/caffe/util/cudnn.hpp
@@ -41,6 +41,10 @@ inline const char* cudnnGetErrorString(cudnnStatus_t status) {
       return "CUDNN_STATUS_NOT_SUPPORTED";
     case CUDNN_STATUS_LICENSE_ERROR:
       return "CUDNN_STATUS_LICENSE_ERROR";
+#if CUDNN_VERSION_MIN(6, 0, 0)
+    case CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING:
+      return "CUDNN_STATUS_RUNTIME_PREREQUISITE_MISSING";
+#endif
   }
   return "Unknown cudnn status";
 }
@@ -91,8 +95,13 @@ template <typename Dtype>
 inline void createFilterDesc(cudnnFilterDescriptor_t* desc,
     int n, int c, int h, int w) {
   CUDNN_CHECK(cudnnCreateFilterDescriptor(desc));
+#if CUDNN_VERSION_MIN(5, 0, 0)
   CUDNN_CHECK(cudnnSetFilter4dDescriptor(*desc, dataType<Dtype>::type,
-      n, c, h, w));
+      CUDNN_TENSOR_NCHW, n, c, h, w));
+#else
+  CUDNN_CHECK(cudnnSetFilter4dDescriptor_v4(*desc, dataType<Dtype>::type,
+      CUDNN_TENSOR_NCHW, n, c, h, w));
+#endif
 }
 
 template <typename Dtype>
@@ -104,8 +113,14 @@ template <typename Dtype>
 inline void setConvolutionDesc(cudnnConvolutionDescriptor_t* conv,
     cudnnTensorDescriptor_t bottom, cudnnFilterDescriptor_t filter,
     int pad_h, int pad_w, int stride_h, int stride_w) {
+#if CUDNN_VERSION_MIN(6, 0, 0)
   CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv,
+      pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION,
+      dataType<Dtype>::type));
+#else
+    CUDNN_CHECK(cudnnSetConvolution2dDescriptor(*conv,
       pad_h, pad_w, stride_h, stride_w, 1, 1, CUDNN_CROSS_CORRELATION));
+#endif
 }
 
 template <typename Dtype>
@@ -123,8 +138,21 @@ inline void createPoolingDesc(cudnnPoolingDescriptor_t* pool_desc,
     LOG(FATAL) << "Unknown pooling method.";
   }
   CUDNN_CHECK(cudnnCreatePoolingDescriptor(pool_desc));
-  CUDNN_CHECK(cudnnSetPooling2dDescriptor(*pool_desc, *mode, h, w,
-        pad_h, pad_w, stride_h, stride_w));
+#if CUDNN_VERSION_MIN(5, 0, 0)
+  CUDNN_CHECK(cudnnSetPooling2dDescriptor(*pool_desc, *mode,
+        CUDNN_PROPAGATE_NAN, h, w, pad_h, pad_w, stride_h, stride_w));
+#else
+  CUDNN_CHECK(cudnnSetPooling2dDescriptor_v4(*pool_desc, *mode,
+        CUDNN_PROPAGATE_NAN, h, w, pad_h, pad_w, stride_h, stride_w));
+#endif
+}
+
+template <typename Dtype>
+inline void createActivationDescriptor(cudnnActivationDescriptor_t* activ_desc,
+    cudnnActivationMode_t mode) {
+  CUDNN_CHECK(cudnnCreateActivationDescriptor(activ_desc));
+  CUDNN_CHECK(cudnnSetActivationDescriptor(*activ_desc, mode,
+                                           CUDNN_PROPAGATE_NAN, Dtype(0)));
 }
 
 }  // namespace cudnn
diff --git a/src/caffe/layers/cudnn_conv_layer.cu b/src/caffe/layers/cudnn_conv_layer.cu
index 42c4fd0..8bc5346 100644
--- a/src/caffe/layers/cudnn_conv_layer.cu
+++ b/src/caffe/layers/cudnn_conv_layer.cu
@@ -30,19 +30,11 @@ void CuDNNConvolutionLayer<Dtype>::Forward_gpu(
       // Bias.
       if (this->bias_term_) {
         const Dtype* bias_data = this->blobs_[1]->gpu_data();
-#if CUDNN_VERSION_MIN(4, 0, 0)
         CUDNN_CHECK(cudnnAddTensor(handle_[g],
               cudnn::dataType<Dtype>::one,
               bias_desc_, bias_data + bias_offset_ * g,
               cudnn::dataType<Dtype>::one,
               top_descs_[i], top_data + top_offset_ * g));
-#else
-        CUDNN_CHECK(cudnnAddTensor(handle_[g], CUDNN_ADD_SAME_C,
-              cudnn::dataType<Dtype>::one,
-              bias_desc_, bias_data + bias_offset_ * g,
-              cudnn::dataType<Dtype>::one,
-              top_descs_[i], top_data + top_offset_ * g));
-#endif
       }
     }
 
@@ -82,7 +74,7 @@ void CuDNNConvolutionLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
       // Gradient w.r.t. weights.
       if (this->param_propagate_down_[0]) {
         const Dtype* bottom_data = bottom[i]->gpu_data();
-        CUDNN_CHECK(cudnnConvolutionBackwardFilter_v3(
+        CUDNN_CHECK(cudnnConvolutionBackwardFilter(
               handle_[1*this->group_ + g],
               cudnn::dataType<Dtype>::one,
               bottom_descs_[i], bottom_data + bottom_offset_ * g,
@@ -100,7 +92,7 @@ void CuDNNConvolutionLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
           weight = this->blobs_[0]->gpu_data();
         }
         Dtype* bottom_diff = bottom[i]->mutable_gpu_diff();
-        CUDNN_CHECK(cudnnConvolutionBackwardData_v3(
+        CUDNN_CHECK(cudnnConvolutionBackwardData(
               handle_[2*this->group_ + g],
               cudnn::dataType<Dtype>::one,
               filter_desc_, weight + this->weight_offset_ * g,
diff --git a/src/caffe/layers/cudnn_relu_layer.cpp b/src/caffe/layers/cudnn_relu_layer.cpp
index c86c690..687c905 100644
--- a/src/caffe/layers/cudnn_relu_layer.cpp
+++ b/src/caffe/layers/cudnn_relu_layer.cpp
@@ -13,6 +13,7 @@ void CuDNNReLULayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
   CUDNN_CHECK(cudnnCreate(&handle_));
   cudnn::createTensor4dDesc<Dtype>(&bottom_desc_);
   cudnn::createTensor4dDesc<Dtype>(&top_desc_);
+  cudnn::createActivationDescriptor<Dtype>(&activ_desc_, CUDNN_ACTIVATION_RELU);
   handles_setup_ = true;
 }
 
@@ -35,6 +36,7 @@ CuDNNReLULayer<Dtype>::~CuDNNReLULayer() {
 
   cudnnDestroyTensorDescriptor(this->bottom_desc_);
   cudnnDestroyTensorDescriptor(this->top_desc_);
+  cudnnDestroyActivationDescriptor(this->activ_desc_);
   cudnnDestroy(this->handle_);
 }
 
diff --git a/src/caffe/layers/cudnn_relu_layer.cu b/src/caffe/layers/cudnn_relu_layer.cu
index 9f61718..e7928bb 100644
--- a/src/caffe/layers/cudnn_relu_layer.cu
+++ b/src/caffe/layers/cudnn_relu_layer.cu
@@ -15,12 +15,21 @@ void CuDNNReLULayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
 
   const Dtype* bottom_data = bottom[0]->gpu_data();
   Dtype* top_data = top[0]->mutable_gpu_data();
+#if CUDNN_VERSION_MIN(5, 0, 0)
   CUDNN_CHECK(cudnnActivationForward(this->handle_,
-        CUDNN_ACTIVATION_RELU,
+        activ_desc_,
         cudnn::dataType<Dtype>::one,
         this->bottom_desc_, bottom_data,
         cudnn::dataType<Dtype>::zero,
         this->top_desc_, top_data));
+#else
+  CUDNN_CHECK(cudnnActivationForward_v4(this->handle_,
+        activ_desc_,
+        cudnn::dataType<Dtype>::one,
+        this->bottom_desc_, bottom_data,
+        cudnn::dataType<Dtype>::zero,
+        this->top_desc_, top_data));
+#endif
 }
 
 template <typename Dtype>
@@ -40,13 +49,23 @@ void CuDNNReLULayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
   const Dtype* top_diff = top[0]->gpu_diff();
   const Dtype* bottom_data = bottom[0]->gpu_data();
   Dtype* bottom_diff = bottom[0]->mutable_gpu_diff();
+#if CUDNN_VERSION_MIN(5, 0, 0)
   CUDNN_CHECK(cudnnActivationBackward(this->handle_,
-        CUDNN_ACTIVATION_RELU,
+        activ_desc_,
         cudnn::dataType<Dtype>::one,
         this->top_desc_, top_data, this->top_desc_, top_diff,
         this->bottom_desc_, bottom_data,
         cudnn::dataType<Dtype>::zero,
         this->bottom_desc_, bottom_diff));
+#else
+  CUDNN_CHECK(cudnnActivationBackward_v4(this->handle_,
+        activ_desc_,
+        cudnn::dataType<Dtype>::one,
+        this->top_desc_, top_data, this->top_desc_, top_diff,
+        this->bottom_desc_, bottom_data,
+        cudnn::dataType<Dtype>::zero,
+        this->bottom_desc_, bottom_diff));
+#endif
 }
 
 INSTANTIATE_LAYER_GPU_FUNCS(CuDNNReLULayer);
diff --git a/src/caffe/layers/cudnn_sigmoid_layer.cpp b/src/caffe/layers/cudnn_sigmoid_layer.cpp
index ccb955c..3ce6aef 100644
--- a/src/caffe/layers/cudnn_sigmoid_layer.cpp
+++ b/src/caffe/layers/cudnn_sigmoid_layer.cpp
@@ -13,6 +13,8 @@ void CuDNNSigmoidLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
   CUDNN_CHECK(cudnnCreate(&handle_));
   cudnn::createTensor4dDesc<Dtype>(&bottom_desc_);
   cudnn::createTensor4dDesc<Dtype>(&top_desc_);
+  cudnn::createActivationDescriptor<Dtype>(&activ_desc_,
+      CUDNN_ACTIVATION_SIGMOID);
   handles_setup_ = true;
 }
 
diff --git a/src/caffe/layers/cudnn_sigmoid_layer.cu b/src/caffe/layers/cudnn_sigmoid_layer.cu
index e2a4b46..48d6cba 100644
--- a/src/caffe/layers/cudnn_sigmoid_layer.cu
+++ b/src/caffe/layers/cudnn_sigmoid_layer.cu
@@ -10,12 +10,21 @@ void CuDNNSigmoidLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
     const vector<Blob<Dtype>*>& top) {
   const Dtype* bottom_data = bottom[0]->gpu_data();
   Dtype* top_data = top[0]->mutable_gpu_data();
+#if CUDNN_VERSION_MIN(5, 0, 0)
   CUDNN_CHECK(cudnnActivationForward(this->handle_,
-        CUDNN_ACTIVATION_SIGMOID,
+        activ_desc_,
         cudnn::dataType<Dtype>::one,
         this->bottom_desc_, bottom_data,
         cudnn::dataType<Dtype>::zero,
         this->top_desc_, top_data));
+#else
+  CUDNN_CHECK(cudnnActivationForward_v4(this->handle_,
+        activ_desc_,
+        cudnn::dataType<Dtype>::one,
+        this->bottom_desc_, bottom_data,
+        cudnn::dataType<Dtype>::zero,
+        this->top_desc_, top_data));
+#endif
 }
 
 template <typename Dtype>
@@ -30,13 +39,23 @@ void CuDNNSigmoidLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
   const Dtype* top_diff = top[0]->gpu_diff();
   const Dtype* bottom_data = bottom[0]->gpu_data();
   Dtype* bottom_diff = bottom[0]->mutable_gpu_diff();
+#if CUDNN_VERSION_MIN(5, 0, 0)
   CUDNN_CHECK(cudnnActivationBackward(this->handle_,
-        CUDNN_ACTIVATION_SIGMOID,
+        activ_desc_,
         cudnn::dataType<Dtype>::one,
         this->top_desc_, top_data, this->top_desc_, top_diff,
         this->bottom_desc_, bottom_data,
         cudnn::dataType<Dtype>::zero,
         this->bottom_desc_, bottom_diff));
+#else
+  CUDNN_CHECK(cudnnActivationBackward_v4(this->handle_,
+        activ_desc_,
+        cudnn::dataType<Dtype>::one,
+        this->top_desc_, top_data, this->top_desc_, top_diff,
+        this->bottom_desc_, bottom_data,
+        cudnn::dataType<Dtype>::zero,
+        this->bottom_desc_, bottom_diff));
+#endif
 }
 
 INSTANTIATE_LAYER_GPU_FUNCS(CuDNNSigmoidLayer);
diff --git a/src/caffe/layers/cudnn_tanh_layer.cpp b/src/caffe/layers/cudnn_tanh_layer.cpp
index 1a56418..e87dd9d 100644
--- a/src/caffe/layers/cudnn_tanh_layer.cpp
+++ b/src/caffe/layers/cudnn_tanh_layer.cpp
@@ -13,6 +13,7 @@ void CuDNNTanHLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
   CUDNN_CHECK(cudnnCreate(&handle_));
   cudnn::createTensor4dDesc<Dtype>(&bottom_desc_);
   cudnn::createTensor4dDesc<Dtype>(&top_desc_);
+  cudnn::createActivationDescriptor<Dtype>(&activ_desc_, CUDNN_ACTIVATION_TANH);
   handles_setup_ = true;
 }
 
diff --git a/src/caffe/layers/cudnn_tanh_layer.cu b/src/caffe/layers/cudnn_tanh_layer.cu
index 89df28a..6b5d7ae 100644
--- a/src/caffe/layers/cudnn_tanh_layer.cu
+++ b/src/caffe/layers/cudnn_tanh_layer.cu
@@ -10,12 +10,21 @@ void CuDNNTanHLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
     const vector<Blob<Dtype>*>& top) {
   const Dtype* bottom_data = bottom[0]->gpu_data();
   Dtype* top_data = top[0]->mutable_gpu_data();
+#if CUDNN_VERSION_MIN(5, 0, 0)
   CUDNN_CHECK(cudnnActivationForward(this->handle_,
-        CUDNN_ACTIVATION_TANH,
+        activ_desc_,
         cudnn::dataType<Dtype>::one,
         this->bottom_desc_, bottom_data,
         cudnn::dataType<Dtype>::zero,
         this->top_desc_, top_data));
+#else
+  CUDNN_CHECK(cudnnActivationForward_v4(this->handle_,
+        activ_desc_,
+        cudnn::dataType<Dtype>::one,
+        this->bottom_desc_, bottom_data,
+        cudnn::dataType<Dtype>::zero,
+        this->top_desc_, top_data));
+#endif
 }
 
 template <typename Dtype>
@@ -31,13 +40,23 @@ void CuDNNTanHLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
   const Dtype* bottom_data = bottom[0]->gpu_data();
   Dtype* bottom_diff = bottom[0]->mutable_gpu_diff();
 
+#if CUDNN_VERSION_MIN(5, 0, 0)
   CUDNN_CHECK(cudnnActivationBackward(this->handle_,
-        CUDNN_ACTIVATION_TANH,
+        activ_desc_,
         cudnn::dataType<Dtype>::one,
         this->top_desc_, top_data, this->top_desc_, top_diff,
         this->bottom_desc_, bottom_data,
         cudnn::dataType<Dtype>::zero,
         this->bottom_desc_, bottom_diff));
+#else
+  CUDNN_CHECK(cudnnActivationBackward_v4(this->handle_,
+        activ_desc_,
+        cudnn::dataType<Dtype>::one,
+        this->top_desc_, top_data, this->top_desc_, top_diff,
+        this->bottom_desc_, bottom_data,
+        cudnn::dataType<Dtype>::zero,
+        this->bottom_desc_, bottom_diff));
+#endif
 }
 
 INSTANTIATE_LAYER_GPU_FUNCS(CuDNNTanHLayer);
cp Makefile.config.example Makefile.config
make
make pycaffe

3. faster-rcnn:

cd /home/ubuntu/py-faster-rcnn

Apply this:

diff --git a/caffe-fast-rcnn b/caffe-fast-rcnn
--- a/caffe-fast-rcnn
+++ b/caffe-fast-rcnn
@@ -1 +1 @@
-Subproject commit 0dcd397b29507b8314e252e850518c5695efbb83
+Subproject commit 0dcd397b29507b8314e252e850518c5695efbb83-dirty
diff --git a/data/scripts/fetch_faster_rcnn_models.sh b/data/scripts/fetch_faster_rcnn_models.sh
index 9b76fd5..d4d98a6 100755
--- a/data/scripts/fetch_faster_rcnn_models.sh
+++ b/data/scripts/fetch_faster_rcnn_models.sh
@@ -25,7 +25,7 @@ fi
 
 echo "Downloading Faster R-CNN demo models (695M)..."
 
-wget $URL -O $FILE
+wget --no-check-certificate $URL -O $FILE
 
 echo "Unzipping..."
cd lib
make

4. run:

cd /home/ubuntu/py-faster-rcnn
./data/scripts/fetch_faster_rcnn_models.sh
./tools/demo.py

Edit: try this when met ‘TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’’

sudo apt-get install python-gi-cairo

Thanks Guys
I will do your steps and see.
Thanks again.

When I Run

 cd /home/ubuntu/py-faster-rcnn
 ./data/scripts/fetch_faster_rcnn_models.sh
 ./tools/demo.py

File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 339, in idle_draw
self.draw()
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 332, in draw
self.get_property(“window”).process_updates (False)
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 339, in idle_draw
self.draw()
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 332, in draw
self.get_property(“window”).process_updates (False)
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 339, in idle_draw
self.draw()
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 332, in draw
self.get_property(“window”).process_updates (False)
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 339, in idle_draw
self.draw()
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 332, in draw
self.get_property(“window”).process_updates (False)
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 339, in idle_draw
self.draw()
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 332, in draw
self.get_property(“window”).process_updates (False)
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 339, in idle_draw
self.draw()
File “/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py”, line 332, in draw
self.get_property(“window”).process_updates (False)
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’
TypeError: Couldn’t find foreign struct converter for ‘cairo.Context’

Hi,

Thanks for your feedback.

Could you tried following command and run it again?

sudo apt-get install python-gi-cairo

Information extracted from https://github.com/rbgirshick/py-faster-rcnn/issues/221

Thanks @AsdtaLLL to help me, I didi and i got the following:

ubuntu@tegra-ubuntu:~/py-faster-rcnn$ sudo apt-get install python-gobject-cairo
[sudo] password for ubuntu:

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package python-gobject-cairo

and when I run ./tools/demo.py

Demo for data/demo/001763.jpg
Detection took 5.584s for 196 object proposals

Demo for data/demo/004545.jpg
Detection took 8.216s for 300 object proposals
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'
TypeError: Couldn't find foreign struct converter for 'cairo.Context'

Hi,

Thanks for your feedback and sorry for my typo.

Please try this:

sudo apt-get install python-gi-cairo

Now, It works Thanks @AastaLLL
Thanks for your time really I appropriated that.

Hi,

I’m trying to run py-faster-rcnn on a TX2. I have installed everything correctly but when I try to run demo.py I get the error below:

I0817 14:27:45.408632 9210 net.cpp:413] Input 0 -> data
F0817 14:27:45.739578 9210 syncedmem.hpp:18] Check failed: error == cudaSuccess (30 vs. 0) unknown error
*** Check failure stack trace: ***
Aborted (core dumped)

How do I get around this problem? I saw only that usually when people get “error == cudaSuccess (30 vs. 0)” you want to install nvidia-modprobe. But I don’t think that’s available for the TX2?

Hi,

Try this command:

sudo ldconfig /usr/local/cuda/lib64

By the way, faster-RCNN is in our TensorRT sample now.
Source is located at ‘/usr/src/tensorrt/’

Thanks.

I fixed the problem by using JetPack to reinstall everything (OS and drivers).
I don’t have “/usr/src/tensorrt/” for some reason, even though I just did a full reinstall.
Also, my py-faster-rcnn is customized (background + 1 class), so the sample is probably not what I want to use anyway.

I do however, have this question. How much faster is using TensorRT compared to just running “python demo.py”?

Hi,

Taster-rcnn sample targets for demonstrating TensorRT Plugin API.
You can change the source to your usage.

We don’t have compared tensorRT and Caffe on Faster-RCNN sample directly.
Here is some performance evaluation:
TensorRT1.0 v.s. Caffe

TensorRT2.1 v.s. TensorRT1.0

Good

Good

Hello, I’m new to linux and was wondering when you said Apply this

diff --git a/Makefile b/Makefile
index 598d28d…90000b2 100644
— a/Makefile
+++ b/Makefile
@@ -178,7 +178,7 @@ ifneq ($(CPU_ONLY), 1)
LIBRARIES := cudart cublas curand
endif

-LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
+LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

handle IO dependencies

USE_LEVELDB ?= 1
diff --git a/Makefile.config.example b/Makefile.config.example
index 8fd49c9…dc2cd69 100644
— a/Makefile.config.example
+++ b/Makefile.config.example

how exactly do I do this? I tried internet but didn’t help much.
Thanks in advance!~

maybe this will help

http://manpages.ubuntu.com/manpages/xenial/man1/patch.1.html

Thanks for the reply. But can’t help wondering, do I have to save the source code(diff --git a/Makefile b/Makefile…etc) as a file or run them straight from the terminal? If you could guide me step by step I’d be grateful!
Thanks

The 4th post on this thread already provides a step-by-step guide. Every time he says “Apply this” just use the patch command to patch the original source with the patchfile. If you git cloned the repo you should already have all the source code.