Skip to content

Commit

Permalink
Perception: update TensorRT permute layer & support Cuda11
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroldchen authored and storypku committed Dec 25, 2020
1 parent fc06583 commit a8fc19f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
20 changes: 12 additions & 8 deletions modules/perception/inference/tensorrt/rt_net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,18 @@ void RTNet::addPermuteLayer(const LayerParameter &layer_param,
nvinfer1::INetworkDefinition *net,
TensorMap *tensor_map,
TensorModifyMap *tensor_modify_map) {
nvinfer1::IPluginLayer *permuteLayer;
nvinfer1::plugin::Quadruple permuteOrder;
CHECK_EQ(layer_param.permute_param().order_size(), 4);
for (int i = 0; i < 4; i++) {
permuteOrder.data[i] = layer_param.permute_param().order(i);
}
nvinfer1::IPlugin *mplugin = createSSDPermutePlugin(permuteOrder);
permuteLayer = net->addPlugin(inputs, nbInputs, *mplugin);
CHECK_LE(layer_param.permute_param().order_size(), nvinfer1::Dims::MAX_DIMS);
nvinfer1::IShuffleLayer *permuteLayer = net->addShuffle(*inputs[0]);
nvinfer1::Permutation permutation;

// For loading Caffe's permute param,
// e.g. Caffe: [0, 2, 1, 3] -> TensorRT: [1, 0, 2], omitting 1st dim N.
ACHECK(layer_param.permute_param().order(0) == 0);
for (int i = 1; i < layer_param.permute_param().order_size(); ++i) {
int order = layer_param.permute_param().order(i);
permutation.order[i - 1] = order - 1;
}
permuteLayer->setFirstTranspose(permutation);

permuteLayer->setName(layer_param.name().c_str());
ConstructMap(layer_param, permuteLayer, tensor_map, tensor_modify_map);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cc_library(
"//modules/perception/lidar/lib/tracker/common:mlf_track_data_with_track_pool_types",
"//modules/perception/lidar/lib/tracker/multi_lidar_fusion:mlf_track_object_matcher",
"//modules/perception/lidar/lib/tracker/multi_lidar_fusion:mlf_tracker",
"//modules/perception/lidar/lib/tracker/semantic_map:perception_evaluator_manager",
"//modules/perception/onboard/msg_serializer",
"//modules/prediction/container/obstacles:obstacles_container",
"//modules/prediction/container/pose:pose_container",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ bool MlfEngine::Init(const MultiTargetTrackerInitOptions& options) {
tracker_.reset(new MlfTracker);
MlfTrackerInitOptions tracker_init_options;
ACHECK(tracker_->Init(tracker_init_options));
evaluator_.Init();
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "modules/perception/lidar/lib/interface/base_multi_target_tracker.h"
#include "modules/perception/lidar/lib/tracker/multi_lidar_fusion/mlf_track_object_matcher.h"
#include "modules/perception/lidar/lib/tracker/multi_lidar_fusion/mlf_tracker.h"
#include "modules/perception/lidar/lib/tracker/semantic_map/evaluator_manager.h"
#include "modules/perception/onboard/msg_serializer/msg_serializer.h"
#include "modules/perception/proto/perception_obstacle.pb.h"
#include "modules/prediction/container/obstacles/obstacles_container.h"
Expand Down Expand Up @@ -120,7 +119,7 @@ class MlfEngine : public BaseMultiTargetTracker {
apollo::prediction::PoseContainer pose_container_;
apollo::perception::onboard::MsgSerializer serializer_;
bool use_semantic_map_ = false;
apollo::perception::EvaluatorManager evaluator_;
// apollo::perception::EvaluatorManager evaluator_;
};

} // namespace lidar
Expand Down

0 comments on commit a8fc19f

Please sign in to comment.