具体错误如下:
File "E:\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\conv.py", line 460, in forward
return self._conv_forward(input, self.weight, self.bias)
File "E:\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\conv.py", line 456, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: "slow_conv2d_cpu" not implemented for 'Half'
如果按照精度问题修改还是会报错
我的解决方法是看看配置文件的参数和模块是否都完整成功的导入
比如yolo.py文件或者general.py文件:
from utils.general import LOGGER, check_version, check_yaml,colorstr, make_divisible,print_args
from utils.torch_utils import (
fuse_conv_and_bn,
initialize_weights,
model_info,
profile,
scale_img,
select_device,
time_sync,
)
补齐配置文件的参数就迎刃而解啦~