Skip to content

Conversation

@jiangjiajun
Copy link
Collaborator

@jiangjiajun jiangjiajun commented Jul 24, 2022

  • CMakeLists指定编译的代码路径及生成的lib库名
  • RuntimeOption增加配置函数接口
  • TensorRT增加检查模型Shape配置,提前拦截TRT的错误,给出明确的提示

@jiangjiajun
Copy link
Collaborator Author

  • RuntimeOption缺配置CacheTrtFile选项
  • 日志缺少关闭WARNING和INFO选项

assert index < self.num_inputs(), "The input parameter index:{} should less than number of inputs:{}.".format(index, self.num_inputs)
assert isinstance(
index, int), "The input parameter index should be type of int."
assert index < self.num_inputs(
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码命名直接由fastdeploy_runtime.py 改为runtime.py

.def("num_outputs", &Runtime::NumOutputs)
.def("get_input_info", &Runtime::GetInputInfo)
.def("get_output_info", &Runtime::GetOutputInfo)
.def_readonly("option", &Runtime::option);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

变量的绑定需要移除


bool DISABLE_WARNING = false;
bool DISABLE_INFO = false;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两行代码还没用到,需要删除

namespace fastdeploy {

extern bool DISABLE_WARNING;
extern bool DISABLE_INFO;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

CMAKE_MINIMUM_REQUIRED (VERSION 3.16)

# 在低版本ABI环境中,通过如下代码进行兼容性编译
# add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ABI的注释需移除,改为提示用户编译器版本信息

auto option = fastdeploy::RuntimeOption();
option.device = fastdeploy::Device::CPU;
option.backend = fastdeploy::Backend::PDINFER;
option.backend = fastdeploy::Backend::TRT;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处需删除

option.UseTrtBackend();
option.SetTrtInputShape("images", {1, 3, 320, 320}, {1, 3, 640, 640},
{1, 3, 1280, 1280});
auto model = vis::ultralytics::YOLOv5("yolov5s.onnx", "", option);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处需删除

option.backend = fastdeploy::Backend::TRT;
option.trt_fixed_shape["images"] = {1, 3, 640, 640};
auto model = vis::megvii::YOLOX("yolox_s.onnx", "", option);
if (!model.Initialized()) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处需删除

model = fd.vision.megvii.YOLOX("yolox_s.onnx")
option = fd.RuntimeOption()
option.use_trt_backend()
model = fd.vision.megvii.YOLOX("yolox_s.onnx", runtime_option=option)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处需删除

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants