efficientdet-pytorch icon indicating copy to clipboard operation
efficientdet-pytorch copied to clipboard

训练问题

Open Pauldogsama opened this issue 4 years ago • 3 comments

博主您好。 训练过程中,会突然报错,错误代码如下所示: E:\py_file\efficientdet-pytorch-master\venv\Scripts\python.exe E:/py_file/efficientdet-pytorch-master/train_1.py Loading weights into state dict... Finished! Start Train Epoch 1/50: 26%|██▌ | 428/1675 [09:09<26:39, 1.28s/it, Conf Loss=994, Regression Loss=0.0386, lr=0.001] Traceback (most recent call last): File "E:/py_file/efficientdet-pytorch-master/train_1.py", line 214, in val_loss = fit_one_epoch(net, efficient_loss, epoch, epoch_size, epoch_size_val, gen, gen_val, Freeze_Epoch, Cuda) File "E:/py_file/efficientdet-pytorch-master/train_1.py", line 44, in fit_one_epoch targets = [torch.from_numpy(ann).type(torch.FloatTensor).cuda() for ann in targets] File "E:/py_file/efficientdet-pytorch-master/train_1.py", line 44, in targets = [torch.from_numpy(ann).type(torch.FloatTensor).cuda() for ann in targets] TypeError: can't convert np.ndarray of type numpy.object_. The only supported types are: float64, float32, float16, int64, int32, int16, int8, uint8, and bool.

查询之后没有找到解决办法,希望能得到您的帮助,谢谢

Pauldogsama avatar Jun 14 '21 14:06 Pauldogsama

这个train_1.py是你修改了什么么?

bubbliiiing avatar Jun 16 '21 13:06 bubbliiiing

这个train_1.py是你修改了什么么?

除了标题名称变化,内容中只把batch_size修改为6,代码没有别的改动。 数据集是VOC2007,按教程生成了2007_train.txt

Pauldogsama avatar Jun 16 '21 14:06 Pauldogsama

要不用我提供的07+12试试,我看不出来为什么

bubbliiiing avatar Jun 17 '21 08:06 bubbliiiing