Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yolov5训练出错 #70

Closed
YLiyu opened this issue Dec 7, 2022 · 2 comments
Closed

yolov5训练出错 #70

YLiyu opened this issue Dec 7, 2022 · 2 comments
Labels
question Further information is requested

Comments

@YLiyu
Copy link

YLiyu commented Dec 7, 2022

问题描述 Please describe your issue

在aistudio平台上面,选择是V100_32G的显卡,按照教程安装好环境之后,训练自己的制作的coco数据集,使用的是configs/yolov5/yolov5_m_300e_coco.yml,使用的训练batch_size是16,加载预训练权重,然后开始训练,打印了如下日志:

[12/07 12:01:13] ppdet.utils.checkpoint INFO: Finish loading model weights: /home/aistudio/.cache/paddle/weights/ppyoloe_crn_l_300e_coco.pdparams
[12/07 12:02:20] ppdet.engine INFO: Epoch: [0] [ 0/767] eta: 180 days, 2:09:08 lr: 0.000000 loss_box: 0.053673 loss_obj: 2.675744 loss_cls: 0.209312 loss: 47.019657 batch_cost: 67.6217 data_cost: 65.2064 ips: 0.2366 images/s
^C[12/07 12:05:13] reader WARNING: fail to map sample transform [Decode_190192] with error: 'bytes' object has no attribute 'shape' and stack:
Traceback (most recent call last):
File "/home/aistudio/work/PaddleYOLO/ppdet/data/reader.py", line 54, in call
data = f(data)
File "/home/aistudio/work/PaddleYOLO/ppdet/data/transform/operators.py", line 101, in call
sample[i] = self.apply(sample[i], context)
File "/home/aistudio/work/PaddleYOLO/ppdet/data/transform/operators.py", line 458, in apply
elif sample['h'] != im.shape[0]:
AttributeError: 'bytes' object has no attribute 'shape'

Traceback (most recent call last):
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/dataloader_iter.py", line 745, in next
self.reader.read_next_list()[0])
SystemError: (Fatal) Blocking queue is killed because the data reader raises an exception.
[Hint: Expected killed
!= true, but received killed_:1 == true:1.] (at /paddle/paddle/fluid/operators/reader/blocking_queue.h:175)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "tools/train.py", line 172, in
Exception in thread Thread-1:
Traceback (most recent call last):
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/dataloader_iter.py", line 536, in _thread_loop
batch = self._get_data()
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/dataloader_iter.py", line 674, in _get_data
batch.reraise()
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/worker.py", line 172, in reraise
raise self.exc_type(msg)
AttributeError: DataLoader worker(1) caught AttributeError with message:
Traceback (most recent call last):
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/worker.py", line 339, in _worker_loop
batch = fetcher.fetch(indices)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dataloader/fetcher.py", line 125, in fetch
data.append(self.dataset[idx])
File "/home/aistudio/work/PaddleYOLO/ppdet/data/source/dataset.py", line 94, in getitem
return self.transform(roidb)
File "/home/aistudio/work/PaddleYOLO/ppdet/data/reader.py", line 60, in call
raise e
File "/home/aistudio/work/PaddleYOLO/ppdet/data/reader.py", line 54, in call
data = f(data)
File "/home/aistudio/work/PaddleYOLO/ppdet/data/transform/operators.py", line 101, in call
sample[i] = self.apply(sample[i], context)
File "/home/aistudio/work/PaddleYOLO/ppdet/data/transform/operators.py", line 458, in apply
elif sample['h'] != im.shape[0]:
AttributeError: 'bytes' object has no attribute 'shape'
我不知道是为什么,感谢解答

@nemonameless
Copy link
Collaborator

你好,报bug请按模板提问以便排查,https://github.com/PaddlePaddle/PaddleYOLO/issues/new?assignees=&labels=type%2Fbug-report%2Cstatus%2Fnew-issue&template=1_bug-report.yml
至少说明下环境和代码配置等改动,谢谢。

@nemonameless nemonameless added the question Further information is requested label Dec 9, 2022
@nemonameless
Copy link
Collaborator

报错请说明改动,自定义数据集请先自查制作无误后再训,以及使用最新代码。如还有问题可回复可重开。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants