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
相关产品推荐
相关产品推荐

