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

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6,) + inhomogeneous part. #28

Open
xyj176 opened this issue Sep 5, 2023 · 0 comments

Comments

@xyj176
Copy link

xyj176 commented Sep 5, 2023

--- load weight finish ---
Setting up a new session...
Max_iter = 120000, Batch_size = 20
Model will train on cuda:[0]
--- Focal_loss alpha = 0.25 ,将对背景类进行衰减,请在目标检测任务中使用 ---
--- Multiboxloss : α=0.25 γ=2 num_classes=21
Set optimizer : SGD (
Parameter Group 0
dampening: 0
initial_lr: 0.001
lr: 0.001
momentum: 0.9
nesterov: False
weight_decay: 0.0005
)
Set scheduler : <torch.optim.lr_scheduler.MultiStepLR object at 0x00000248040508B0>
Set lossfunc : multiboxloss(
(loc_loss_fn): SmoothL1Loss()
(cls_loss_fn): focal_loss()
)
Start Train......


Traceback (most recent call last):
File "D:\software\PyCharm\PyCharm Community Edition 2022.1.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1491, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\software\PyCharm\PyCharm Community Edition 2022.1.3\plugins\python-ce\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/code/ai/Retinanet/Retinanet-Pytorch-master/Demo_train.py", line 36, in
trainer(net, train_dataset)
File "D:\code\ai\Retinanet\Retinanet-Pytorch-master\Model\trainer.py", line 112, in call
for iteration, (images, boxes, labels, image_names) in enumerate(data_loader):
File "D:\software\supermap\idesktopX\support\MiniConda\conda\envs\retinanet\lib\site-packages\torch\utils\data\dataloader.py", line 435, in next
data = self._next_data()
File "D:\software\supermap\idesktopX\support\MiniConda\conda\envs\retinanet\lib\site-packages\torch\utils\data\dataloader.py", line 1085, in _next_data
return self._process_data(data)
File "D:\software\supermap\idesktopX\support\MiniConda\conda\envs\retinanet\lib\site-packages\torch\utils\data\dataloader.py", line 1111, in _process_data
data.reraise()
File "D:\software\supermap\idesktopX\support\MiniConda\conda\envs\retinanet\lib\site-packages\torch_utils.py", line 428, in reraise
raise self.exc_type(msg)
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "D:\software\supermap\idesktopX\support\MiniConda\conda\envs\retinanet\lib\site-packages\torch\utils\data_utils\worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "D:\software\supermap\idesktopX\support\MiniConda\conda\envs\retinanet\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\software\supermap\idesktopX\support\MiniConda\conda\envs\retinanet\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\code\ai\Retinanet\Retinanet-Pytorch-master\Data\Dataset_VOC.py", line 48, in getitem
image, boxes, labels = self.transform(image, boxes, labels)
File "D:\code\ai\Retinanet\Retinanet-Pytorch-master\Data\Transfroms.py", line 40, in call
img, boxes, labels = t(img, boxes, labels)
File "D:\code\ai\Retinanet\Retinanet-Pytorch-master\Data\Transfroms_utils.py", line 263, in call
mode = random.choice(self.sample_options)
File "mtrand.pyx", line 920, in numpy.random.mtrand.RandomState.choice
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6,) + inhomogeneous part.
请问这是什么原因导致的呀

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

No branches or pull requests

1 participant