python - TensorFlow 服务非常不稳定
问题描述
我在带有 TF 服务的 Tesla T4 中部署了一个更快的 rcnn 模型和两个分段模型。不知何故,较旧的 tf 服务版本(1.15.0)比最新的 tf 服务版本工作得更好(可能是因为模型是在旧 tf 版本上构建并导出的)。我正在使用以下环境变量
TF_FORCE_GPU_ALLOW_GROWTH=true # This helped me to get over the OOM errors while loading the models
我曾经批量处理 300 个 GRPC 请求,并且运行良好。但是目前它在前几批之后经常抛出OOM警告。
2021-10-28 19:04:57.475951: W external/org_tensorflow/tensorflow/core/common_runtime/bfc_allocator.cc:239] Allocator (GPU_0_bfc) ran out of memory trying to allocate 4.01GiB with freed_by_count=0. The caller indicates that this is not a failure, but may mean that there could be performance gains if more memory were available.
关于如何解决这个问题的任何想法?我还注意到推理后没有释放 gpu 内存(这也发生在早些时候,但它没有引发 OOM 错误)。我没有禁用 TF 服务中的垃圾收集。有没有其他方法可以有效地收集垃圾并释放内存?提前致谢 :)。
解决方案
推荐阅读
- ubuntu - 如何在 Ubuntu 18.04 中配置 VSCode 以使用 oh-my-zsh?
- javascript - jQuery 将我的显示内联块更改为无
- video - Microsoft Edge 浏览器中的 Html 视频错误
- android - AAPT2 错误:在 android studio 中检查日志以获取详细信息
- amazon-web-services - 如何在 Amazon 弹性 beanstalk 服务器上保存 pdf 文件?
- javascript - 随机重定向到 url 但 1 个数字更改(通过 Javascript)
- wordpress - 通过 slug 获取 Woocommerce 产品
- laravel - Laravel + Passport api 通过 Auth 获取记录
- swift - 如何使用 textfield() 函数快速检查我的文本字段上的所有验证
- opencl - OpenCL 本身是否具有 HDL 的 FPGA 后端?