如何在Jetson TX1上安装py-faster-rcnn?

时间:2017-08-05 08:11:36

标签: caffe nvidia pycaffe

我想在TX1上安装py-faster-rcnn,然后我跟着https://devtalk.nvidia.com/default/topic/974063/jetson-tx1/caffe-failed-with-py-faster-rcnn-demo-py-on-tx1/,修改/ caffe-fast-rcnn / Makefile和/caffe-fast-rcnn/Makefile.config,但是当我尝试为了实现它,问题出现了:

ubuntu@tegra-ubuntu:~/py-faster-rcnn/caffe-fast-rcnn$ make
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/layer_factory.cpp
In file included from ./include/caffe/util/device_alternate.hpp:40:0,
                 from ./include/caffe/common.hpp:19,
                 from ./include/caffe/blob.hpp:8,
                 from ./include/caffe/layer.hpp:8,
                 from src/caffe/layer_factory.cpp:8:
./include/caffe/util/cudnn.hpp: In function ‘void  
caffe::cudnn::createPoolingDesc(cudnnPoolingStruct**, 
caffe::PoolingParameter_PoolMethod, cudnnPoolingMode_t*, int, int, 
int, int, int, int)’:
./include/caffe/util/cudnn.hpp:127:41: error: too few arguments to 
function ‘cudnnStatus_t 
cudnnSetPooling2dDescriptor(cudnnPoolingDescriptor_t, 
cudnnPoolingMode_t, cudnnNanPropagation_t, int, int, int, int, int, 
int)’
     pad_h, pad_w, stride_h, stride_w));
                                     ^
./include/caffe/util/cudnn.hpp:15:28: note: in definition of macro 
‘CUDNN_CHECK’
 cudnnStatus_t status = condition; \
                        ^
In file included from ./include/caffe/util/cudnn.hpp:5:0,
                 from ./include/caffe/util/device_alternate.hpp:40,
                 from ./include/caffe/common.hpp:19,
                 from ./include/caffe/blob.hpp:8,
                 from ./include/caffe/layer.hpp:8,
                 from src/caffe/layer_factory.cpp:8:
/usr/include/cudnn.h:803:27: note: declared here
cudnnStatus_t CUDNNWINAPI cudnnSetPooling2dDescriptor(
                       ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetTanHLayer(const 
caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:237:1: warning: control reaches end of 
non-void function [-Wreturn-type]
}
^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetTanHLayer(const 
caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:237:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetSoftmaxLayer(const 
caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:214:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetSoftmaxLayer(const 
caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:214:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetSigmoidLayer(const  
caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:191:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetSigmoidLayer(const 
caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:191:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetReLULayer(const 
caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:168:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetReLULayer(const 
caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:168:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetLRNLayer(const 
caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:145:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetLRNLayer(const 
caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:145:1: warning: control reaches end of 
non-void function [-Wreturn-type]
 }
 ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetPoolingLayer(const 
caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:108:1: warning: control reaches end of 
non-void function [-Wreturn-type]
    }
    ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::GetPoolingLayer(const 
caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layer_factory.cpp:108:1: warning: control reaches end of 
non-void function [-Wreturn-type]
  }
  ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > 
caffe::GetConvolutionLayer(const caffe::LayerParameter&) [with Dtype = 
double]’:
src/caffe/layer_factory.cpp:71:1: warning: control reaches end of non-
void function [-Wreturn-type]
  }
  ^
src/caffe/layer_factory.cpp: In function 
‘boost::shared_ptr<caffe::Layer<Dtype> > 
caffe::GetConvolutionLayer(const caffe::LayerParameter&) [with Dtype = 
float]’:
src/caffe/layer_factory.cpp:71:1: warning: control reaches end of non-
void function [-Wreturn-type]
  }
  ^
Makefile:564: recipe for target 
'.build_release/src/caffe/layer_factory.o' failed
make: *** [.build_release/src/caffe/layer_factory.o] Error 1

如何解决这个问题? 感谢

2 个答案:

答案 0 :(得分:0)

我解决了它,也许原来的py-faster-rcnn不能很好地支持cudnnv5,所以我将以下文件从/ caffe复制到/ py-faster-rcnn / caffe-fast-rcnn:

include/caffe/util/:cudnn.hpp
src/caffe/layers/:cudnn_conv_layer.cu
                  cudnn_relu_layer.cpp
                  cudnn_relu_layer.cu
                  cudnn_sigmoid_layer.cpp
                  cudnn_sigmoid_layer.cu
                  cudnn_tanh_layer.cpp
                  cudnn_tanh_layer.cu

include/caffe/layers/:cudnn_relu_layer.hpp
                      cudnn_sigmoid_layer.hpp
                      cudnn_tanh_layer.hpp

它有效。

答案 1 :(得分:0)

这是一个适合我的解决方案。

将caffe master分支合并到caffe-fast-rcnn。

self_.attr("phase") = static_cast<int>(this->phase_);

合并后从include / caffe / layers / python_layer.hpp中删除System.exit(0);

我是从Live plunk得到的。