You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TensorFlow Object Detection API安装报错:license_file参数已弃用

解决TensorFlow目标检测API安装时的DeprecatedConfig警告问题

我正在按照指定视频及文档搭建TensorFlow目标检测环境,已完成以下操作:

  • 克隆Tensorflow Garden和Coco API
  • 安装ProtoBuff并配置好环境变量

在安装Object Detection API时,执行了以下命令:

cp object_detection/packages/tf2/setup.py .
python -m pip install .

运行python -m pip install .时出现如下警告:

_DeprecatedConfig: Deprecated config in `setup.cfg`
  !!

          ********************************************************************************
          The license_file parameter is deprecated, use license_files instead.

          By 2023-Oct-30, you need to update your project and remove deprecated calls
          or your builds will no longer be supported.

          See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
          ********************************************************************************

  !!

解决步骤

  • 找到当前目录下的setup.cfg文件(执行cp命令后,该文件与setup.py在同一目录)
  • 打开setup.cfg,找到包含license_file的配置行,示例:
    license_file = LICENSE
    
  • 将该行替换为license_files配置,格式如下:
    license_files =
        LICENSE
    
    若有多个许可证文件,可每行添加一个文件名
  • 保存修改后的文件,重新执行python -m pip install .即可

注:这是setuptools版本更新引发的兼容性警告,修改配置后不影响TensorFlow目标检测API的正常安装与使用。

内容的提问来源于stack exchange,提问作者Akash Ram

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 15:52:11