注:init.xavier_uniform 改为 init.xavier_uniform_
2.UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead. targets = [Variable(anno.cuda(), volatile=True) for anno in targets]注:im = Variable(im.cuda(),volatile=True) 应该改成im = Variable(im.cuda())
3.UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number注:loss.data[0] 应该改成loss.item()
4.UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.注:upsample 替换为interpolate
5.UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.warnings.warn(warning.format(ret))注:size_average=False 改为 reduction='sum’