pytorch-buglist:

pytorch报错:RuntimeError: CUDA error: device-side assert triggered
参数:unable to get repr for class 'torch.tensor'

错误定位:类别数目不对;
RuntimeError: Given groups=1, weight of size 40 3 3 3, 
expected input[4, 300, 302, 5] to have 3 channels, but got 300 channels instead

问题描述:训练完第一个epoch后出现上述bug,
原因:验证阶段,图像数据输入维数存在问题,需要变换通道。
RuntimeError: Error(s) in loading state_dict for EfficientNet:
	Missing key(s) in state_dict: "_conv_stem.weight", "_bn0.weight", "_bn0.bias", .... ,"_bn1.running_mean", "_bn1.running_var", "_fc.weight", "_fc.bias". 
	Unexpected key(s) in state_dict: "module._conv_stem.weight", "module._bn0.weight", "module._bn0.bias", ... ,"module._bn1.running_mean", "module._bn1.running_var", "module._bn1.num_batches_tracked", "module._fc.weight", "module._fc.bias". 

原因:模型没有放到GPU上,就载入权重。
改正:模型初始化model = EfficientNet.from_name('efficientnet-b3', 102)
后面加:model = torch.nn.DataParallel(model).cuda()
Traceback (most recent call last)
TypeError: 'module' object is not callable
原因:库没有正确加载
Traceback (most recent call last):
TypeError: 'list' object is not callable
原因:代码中使用内置函数名或关键字定义了变量。
yolov5中的调用问题:
ModuleNotFoundError: No module named 'models'
原因:序列化问题
import os, sys
root_path = os.getcwd()
sys.path.insert(0, root_path + '/project/yolov5')
from project.yolov5.predict import detect
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值