基于基于paddlepaddle框架的安全帽检测
1.安装paddlex库的时候问题频出:
pip install paddlex
什么意思,安装成功了吗?还是说要指定版本,再指定一个网站?但是官方的也下载不了啊!
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:
- Downgrade the protobuf package to 3.20.x or lower.
- 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
这是为什么呀