PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

我训练pp-yolo的时候,报错,是怎么回事?

Open ewwerpm opened this issue 2 years ago • 8 comments

问题确认 Search before asking

  • [X] 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

我按照https://aistudio.baidu.com/aistudio/projectdetail/5485593?forkThirdPart=1 这个链接一步一步执行,到训练的地方,总是报错:找不到模块,是怎么回事?谢谢 aistudio@jupyter-243022-5485593:~/PaddleDetection$ CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python tools/train.py -c configs/ppyolo/ppyolo.yml --eval /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/utils.py:26: 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 def convert_to_list(value, n, name, dtype=np.int): Traceback (most recent call last): File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/ppdet/modeling/ops.py", line 21, in import paddle._legacy_C_ops as C_ops ModuleNotFoundError: No module named 'paddle._legacy_C_ops'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "tools/train.py", line 33, in from ppdet.core.workspace import load_config, merge_config, create File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/ppdet/init.py", line 15, in from . import (core, data, engine, modeling, model_zoo, optimizer, metrics, File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/ppdet/data/init.py", line 16, in from . import transform File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/ppdet/data/transform/init.py", line 15, in from . import operators File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/ppdet/data/transform/operators.py", line 53, in from ppdet.modeling.keypoint_utils import get_affine_transform, affine_transform File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/ppdet/modeling/init.py", line 19, in from . import ops File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/ppdet/modeling/ops.py", line 23, in import paddle._C_ops as C_ops ModuleNotFoundError: No module named 'paddle._C_ops'

ewwerpm avatar Feb 11 '23 10:02 ewwerpm

链接没公开看不到。这个报错是paddle版本和ppdet版本不匹配。PaddleDetection代码请切换到最新develop或2.6分支去使用。

nemonameless avatar Feb 13 '23 11:02 nemonameless

https://aistudio.baidu.com/aistudio/projectdetail/5485593?forkThirdPart=1 这个链接,您访问不了吗?奇怪。如何把PaddleDetection代码切换到2.6分支啊?

ewwerpm avatar Feb 14 '23 03:02 ewwerpm

PaddleDetection

https://aistudio.baidu.com/aistudio/projectdetail/5485314 我把项目公开了,这个链接您能访问吗?谢谢

ewwerpm avatar Feb 17 '23 08:02 ewwerpm

这个项目和代码太老了。去官网安装最新的paddle吧,配合PaddleDetection最新develop或2.6分支,https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/linux-pip.html

代码切换分支很基本的git命令网上查下,代码切换分支到最新develop或2.6分支: git checkout develop 或者重新git clone一份 git clone https://github.com/PaddlePaddle/PaddleDetection.git -b develop

nemonameless avatar Feb 17 '23 08:02 nemonameless

装paddlepaddle-gpu 2.4.2的时候,报错: ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. parl 1.4.1 requires pyzmq==18.1.1, but you have pyzmq 23.2.1 which is incompatible. 换装 paddlepaddle-gpu-2.2.0,安装的时候没有报错,可是运行 !python tools/train.py -c configs/ppyolo/ppyolov2_r50vd_dcn_365e_coco.yml --eval 的时候,报错: AttributeError: module 'paddle.nn.functional' has no attribute 'mish' 这个错误,在百度上搜索,也没有任何结果。怎么办? !python tools/train.py -h 这个命令,运行通过了。谢谢

ewwerpm avatar Feb 18 '23 05:02 ewwerpm

具体的报错内容: /home/aistudio/PaddleDetection /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/tensor/creation.py:130: DeprecationWarning: np.object is a deprecated alias for the builtin object. To silence this warning, use object by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations if data.dtype == np.object: loading annotations into memory... Done (t=0.00s) creating index... index created! W0218 13:20:55.811735 8907 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 10.2 W0218 13:20:55.816414 8907 device_context.cc:465] device: 0, cuDNN Version: 7.6. [02/18 13:20:59] ppdet.utils.checkpoint INFO: Finish loading model weights: /home/aistudio/.cache/paddle/weights/ResNet50_vd_ssld_pretrained.pdparams Traceback (most recent call last): File "tools/train.py", line 177, in main() File "tools/train.py", line 173, in main run(FLAGS, cfg) File "tools/train.py", line 127, in run trainer.train(FLAGS.eval) File "/home/aistudio/PaddleDetection/ppdet/engine/trainer.py", line 454, in train outputs = model(data) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 914, in call outputs = self.forward(*inputs, **kwargs) File "/home/aistudio/PaddleDetection/ppdet/modeling/architectures/meta_arch.py", line 59, in forward out = self.get_loss() File "/home/aistudio/PaddleDetection/ppdet/modeling/architectures/yolo.py", line 125, in get_loss return self._forward() File "/home/aistudio/PaddleDetection/ppdet/modeling/architectures/yolo.py", line 80, in _forward neck_feats = self.neck(body_feats, self.for_mot) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 914, in call outputs = self.forward(*inputs, **kwargs) File "/home/aistudio/PaddleDetection/ppdet/modeling/necks/yolo_fpn.py", line 954, in forward route, tip = self.fpn_blocksi File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 914, in call outputs = self.forward(*inputs, **kwargs) File "/home/aistudio/PaddleDetection/ppdet/modeling/necks/yolo_fpn.py", line 372, in forward conv_left = self.conv1(inputs) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 914, in call outputs = self.forward(*inputs, **kwargs) File "/home/aistudio/PaddleDetection/ppdet/modeling/backbones/darknet.py", line 81, in forward out = getattr(F, self.act)(out) AttributeError: module 'paddle.nn.functional' has no attribute 'mish'

ewwerpm avatar Feb 18 '23 05:02 ewwerpm

!git clone https://gitee.com/paddlepaddle/PaddleDetection.git -b release/2.6 执行这个安装paddleDetection 2.6后(paddlepaddle-gpu-2.2.0),执行 !python tools/train.py -c configs/ppyolo/ppyolov2_r50vd_dcn_365e_coco.yml --eval 还是报错: AttributeError: module 'paddle.nn.functional' has no attribute 'mish'

ewwerpm avatar Feb 18 '23 05:02 ewwerpm

import paddle paddle.fluid.install_check.run_check() Running Verify Fluid Program ... W0218 13:55:49.914819 12850 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 10.2 W0218 13:55:49.919867 12850 device_context.cc:465] device: 0, cuDNN Version: 7.6. Your Paddle Fluid works well on SINGLE GPU or CPU. Your Paddle Fluid works well on MUTIPLE GPU or CPU. Your Paddle Fluid is installed successfully! Let's start deep Learning with Paddle Fluid now exit() aistudio@jupyter-243022-5485314:~/PaddleDetection/configs/ppyolo$ nvcc -V nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2019 NVIDIA Corporation Built on Sun_Jul_28_19:07:16_PDT_2019 Cuda compilation tools, release 10.1, V10.1.243 是这些版本不匹配吗?谢谢

ewwerpm avatar Feb 18 '23 05:02 ewwerpm