赞
踩
以下均为pytorch 1.0.1的报错和原因
1、报错:
block: [0,0,0], thread: [16,0,0] Assertion t 0 && t n_classes failed
原因是训练列表里标签的问题
2、在win下用交叉熵损失,要设num_workers = 0,多线程会报错
3、报错:
Sizes of tensors must match except in dimension 0. Got 36 and 234 in dimension 2
原因是输入数据没有resize到统一尺寸
4、坑:toTensor会自动将数据转为0-1之间,如果数据类型是np.float32,则将数据转为[0,1],如果数据类型是np.uint8则会对每个数除以255,注意用toTensor的话数据类型很关键
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。