南宫子曦_ 2023-12-19 20:44 采纳率: 0%
浏览 32

基于基于paddlepaddle框架的安全帽检测

基于基于paddlepaddle框架的安全帽检测
1.安装paddlex库的时候问题频出:

pip install paddlex

img

什么意思,安装成功了吗?还是说要指定版本,再指定一个网站?但是官方的也下载不了啊!

2.数据集切分出现问题:

!paddlex --split_dataset --format voc --dataset_dir /home/aistudio/helmet/ --val_value 0.2

报错:
If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

什么意思,什么库又对应不上了?怎么看这么多博客都没人说。

pip install protobuf==3.19.0

按照这个把库降级就行了。
·但是我切分数据又不行了:
报错:
AttributeError: module 'pyarrow' has no attribute 'default_serialization_context'
这什么啊?有人解释一下吗?我记得我切分成功是安装了很多乱七八糟的库,现在忘了 ,但是我已经有一份切分好的数据集了。那么安装步骤,接下来就是调用train.py来训练数据集了吧。但是为什么调用这个文件问题这么多,为什么?

调用train.py文件进行数据训练
!python PaddleDetection/tools/train.py -c PaddleDetection/configs/yolov3/yolov3_darknet53_270e_voc.yml

看得我头疼:

python  PaddleDetection/tools/train.py -c PaddleDetection/configs/yolov3/yolov3_darknet53_270e_voc.yml  PaddleDetection/tools/train.py -c PaddleDetection/configs/yolov3/yolov3_darknet53_270e_voc.yml  PaddleDetection/tools/train.py -c PaddleDetection/configs/yolov3/yolov3_darknet53_270e_voc.yml
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/setuptools/depends.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/scipy/sparse/sputils.py:16: DeprecationWarning: `np.typeDict` is a deprecated alias for `np.sctypeDict`.
  supported_dtypes = [np.typeDict[x] for x in supported_dtypes]
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/scipy/linalg/__init__.py:217: DeprecationWarning: The module numpy.dual is deprecated.  Instead of using dual, use the functions directly from numpy or scipy.
  from numpy.dual import register_func
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/scipy/special/orthogonal.py:81: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  from numpy import (exp, inf, pi, sqrt, floor, sin, cos, around, int,
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/numba/types/__init__.py:110: DeprecationWarning: `np.long` is a deprecated alias for `np.compat.long`. To silence this warning, use `np.compat.long` by itself. In the likely event your code does not need to work on Python 2 you can use the builtin `int` for which `np.compat.long` is itself an alias. Doing this will not modify any behaviour and is safe. When replacing `np.long`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  long_ = _make_signed(np.long)
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/numba/types/__init__.py:111: DeprecationWarning: `np.long` is a deprecated alias for `np.compat.long`. To silence this warning, use `np.compat.long` by itself. In the likely event your code does not need to work on Python 2 you can use the builtin `int` for which `np.compat.long` is itself an alias. Doing this will not modify any behaviour and is safe. When replacing `np.long`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  ulong = _make_unsigned(np.long)
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/__init__.py:107: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import MutableMapping
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/rcsetup.py:20: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Iterable, Mapping
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/matplotlib/colors.py:53: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Sized
usage: train.py [-h] [-c CONFIG] [-o [OPT [OPT ...]]] [--eval] [-r RESUME]
                [--slim_config SLIM_CONFIG] [--enable_ce ENABLE_CE] [--amp] [--fleet]
                [--use_vdl USE_VDL] [--vdl_log_dir VDL_LOG_DIR] [--use_wandb USE_WANDB]
                [--save_prediction_only] [--profiler_options PROFILER_OPTIONS] [--save_proposals]
                [--proposals_path PROPOSALS_PATH] [--to_static]
train.py: error: unrecognized arguments: PaddleDetection/tools/train.py PaddleDetection/tools/train.py

这是为什么呀

  • 写回答

1条回答 默认 最新

  • zy_destiny 人工智能领域新星创作者 2023-12-20 14:03
    关注

    最后一个训练过程报错是你的train.py里有一堆参数定义,但是你在训练时没有指定这些参数,而是用了其他的参数。可以尝试把config参数直接在train.py里写成默认值,直接运行python tools/train.py

    评论

报告相同问题?

问题事件

  • 创建了问题 12月19日

悬赏问题

  • ¥15 无法输出helloworld
  • ¥15 高通uboot 打印ubi init err 22
  • ¥20 PDF元数据中的XMP媒体管理属性
  • ¥15 R语言中lasso回归报错
  • ¥15 网站突然不能访问了,上午还好好的
  • ¥15 有没有dl可以帮弄”我去图书馆”秒选道具和积分
  • ¥15 semrush,SEO,内嵌网站,api
  • ¥15 Stata:为什么reghdfe后的因变量没有被发现识别啊
  • ¥15 振荡电路,ADS仿真
  • ¥15 关于#c语言#的问题,请各位专家解答!