博主您好。
训练过程中,会突然报错,错误代码如下所示:
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.
博主您好。 训练过程中,会突然报错,错误代码如下所示: 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.
查询之后没有找到解决办法,希望能得到您的帮助,谢谢