diff --git a/configs/anchor_free/README.md b/configs/anchor_free/README.md index 7c0d196c60324d64864fdedfa605f101ac21e253..184ca2a6e938cc37d3a57e684480e7c0d035beac 100644 --- a/configs/anchor_free/README.md +++ b/configs/anchor_free/README.md @@ -38,6 +38,7 @@ - CornerNet-Squeeze中使用ResNet结构的骨干网络时,加入了FPN结构,骨干网络的输出feature map采用FPN中的P3层输出。 - \*CornerNet-Squeeze-dcn-mixup-cosine是基于原版CornerNet-Squeeze优化效果最好的模型,在ResNet的骨干网络基础上增加mixup预处理和使用cosine_decay - FCOS使用GIoU loss、用location分支预测centerness、左上右下角点偏移量归一化和ground truth中心匹配策略 +- Cornernet-Squeeze模型依赖corner_pooling op,该op在```ppdet/ext_op```中编译得到,具体编译方式请参考[自定义OP的编译过程](../../ppdet/ext_op/README.md) ## 算法细节 diff --git a/ppdet/ext_op/README.md b/ppdet/ext_op/README.md index cc6173b36c3d70d4e30706da12b32523dcc6e00c..6bfeb0e8843abeacedc7e062c0eb5636124a4644 100644 --- a/ppdet/ext_op/README.md +++ b/ppdet/ext_op/README.md @@ -37,6 +37,23 @@ sh make.sh 编译自定义OP时会报错找不到`mkldnn.h`等文件,可在`make.sh`中删除编译命令中的`-DPADDLE_WITH_MKLDNN`选项。 +## 设置环境变量 + +需要将Paddle的核心库设置到`LD_LIBRARY_PATH`里, 先运行下面程序获取路径: + +``` +import paddle +print(paddle.sysconfig.get_lib()) +``` + +可通过如下方式添加动态库路径: + +``` +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`python -c 'import paddle; print(paddle.sysconfig.get_lib())'` +``` + + + ## 执行单测 执行下列单测,确保自定义算子可在网络中正确使用: diff --git a/ppdet/ext_op/src/make.sh b/ppdet/ext_op/src/make.sh index bd0d3a3c904bd9409d200100de6d8e30ca974504..ffc66034f89587806044972335b1a40354407264 100755 --- a/ppdet/ext_op/src/make.sh +++ b/ppdet/ext_op/src/make.sh @@ -19,5 +19,3 @@ g++ bottom_pool_op.cc bottom_pool_op.cu.o top_pool_op.cc top_pool_op.cu.o right_ -L /usr/local/cuda/lib64 -lpaddle_framework -lcudart rm *.cu.o - -export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$lib_dir diff --git a/ppdet/modeling/anchor_heads/corner_head.py b/ppdet/modeling/anchor_heads/corner_head.py index a43416d15c3b110593ae51e8d77ad5866725959c..01e1195b0c68bb66837db29a69ab6e6b9f9f5b6e 100644 --- a/ppdet/modeling/anchor_heads/corner_head.py +++ b/ppdet/modeling/anchor_heads/corner_head.py @@ -246,7 +246,8 @@ class CornerHead(object): try: import cornerpool_lib except: - logger.error("cornerpool_lib not found, compile in ext_op at first") + logger.error( + "cornerpool_lib not found, compile in ppdet/ext_op at first") self.train_batch_size = train_batch_size self.test_batch_size = test_batch_size self.num_classes = num_classes