分批指南用于TensorFlow服务表明,
如果您的系统是仅CPU (没有GPU),那么考虑从以下值开始: num_batch_threads等于CPU核心的数量;max_batch_size to无穷大;
然而,不清楚无穷大对max_batch_size意味着什么。
将值设置为0或-1似乎会导致错误,所以我考虑将其设置为10000,以使其比我可能尝试的任何值都大得多。
尽管如此,文档中关于某些“无穷”值存在的建议给了我不安的睡眠。我怎么才能在这里表示无穷大?
发布于 2020-10-27 13:18:53
查看码源,特别是定义protobuf消息BatchingParameters的文件session_bundle_config.proto,似乎不可能提供无穷大的值。
message BatchingParameters {
// SharedBatchScheduler options (see shared_batch_scheduler.h for more details
// about what each field means):
//
// The maximum size of each input batch.
//
// IMPORTANT: As discussed above, use 'max_batch_size * 2' client threads to
// achieve high throughput with batching.
google.protobuf.Int64Value max_batch_size = 1;
}该BatchingParameters原型消息描述了在batching_parameters.txt中传递的可能选项。它由model_servers/server.cc中的以下一行进行解析:
if (server_options.batching_parameters_file.empty()) {
batching_parameters->mutable_thread_pool_name()->set_value(
"model_server_batch_threads");
} else {
TF_RETURN_IF_ERROR(ParseProtoTextFile<BatchingParameters>(
server_options.batching_parameters_file, batching_parameters));
}我想无限值的替换将是int64的最大值,所以2^63 - 1 (9 223 372 036 854 775 807)
https://stackoverflow.com/questions/64552963
复制相似问题