bubbliiiing / efficientdet-pytorch

这是一个efficientdet-pytorch的源码,可以用于训练自己的模型。
MIT License
305 stars 61 forks source link

训练问题 #22

Open Pauldogsama opened 3 years ago

Pauldogsama commented 3 years ago

博主您好。 训练过程中,会突然报错,错误代码如下所示: 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.fromnumpy(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.

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

bubbliiiing commented 3 years ago

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

Pauldogsama commented 3 years ago

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

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

bubbliiiing commented 3 years ago

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