Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lidar_centerpoint): add a check between the model and config's class size #3101

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions perception/lidar_centerpoint/lib/network/network_trt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "lidar_centerpoint/network/network_trt.hpp"

#include <iostream>

namespace centerpoint
{
bool VoxelEncoderTRT::setProfile(
Expand Down Expand Up @@ -59,6 +61,13 @@ bool HeadTRT::setProfile(

for (std::size_t ci = 0; ci < out_channel_sizes_.size(); ci++) {
auto out_name = network.getOutput(ci)->getName();

if (
out_name == std::string("heatmap") &&
network.getOutput(ci)->getDimensions().d[1] != static_cast<int32_t>(out_channel_sizes_[ci])) {
std::cout << "Expected and actual number of classes do not match" << std::endl;
yukke42 marked this conversation as resolved.
Show resolved Hide resolved
return false;
}
auto out_dims = nvinfer1::Dims4(
config_.batch_size_, out_channel_sizes_[ci], config_.down_grid_size_y_,
config_.down_grid_size_x_);
Expand Down