- 博客(5)
- 资源 (4)
- 收藏
- 关注
转载 Pytorch之gather的用法
首先了解下函数中的参数:torch.gather(input, dim, index, out=None) → TensorParameters:input (Tensor) – The source tensordim (int) – The axis along which to indexindex (LongTensor) – The indices of elements to gatherout (Tensor, optional) – Destination tensor
2021-06-24 21:03:46 258 1
原创 list里面装tensor(pytorch的)如何合并起来
问题简述:使用pytorch中tensor时,有时需要将多个tensor合并成一个高维tensor或者是list中装着多个同纬度的tensor,想让这个list转为tensor核心方法:torch.stack()def stack(tensors: Union[Tuple[Tensor, ...], List[Tensor]], dim: _int=0, *, out: Optional[Tensor]=None) -> Tensor:import torch def li.
2021-06-24 20:45:03 2202 2
转载 Latex中如何设置字体颜色(三种方式)
1.直接使用定义好的颜色\usepackage{color}\textcolor{red/blue/green/black/white/cyan/magenta/yellow}{text}其中textcolor{...}中包含的是系统定义好的颜色2.组合red、green和blue的值合成我们想要的颜色\usepackage{color}\textcolor[rgb]{r,g,b}{text}其中{r,g,b}代表red、green和blue三种颜色的组合,取值范围为[0-.
2021-06-18 10:13:57 19622
转载 torch.clamp()
源于FocalLoss.py损失函数中返回的loss起初是inf, 后续就前篇一律的nan, debug的结果发现代码里出现了probs = log(0), 这不就是出现inf的根源吗? 此处先给出大神的FocalLoss.py,
2021-06-08 20:25:20 644
原创 AttributeError: ‘Tensor‘ object has no attribute ‘bool‘
这个问题是跑b站作者bubbliiiing写的YOLOv4(pytorch版本)代码中出现的问题,具体是计算CIoU的过程中需要将mask的值转化为bool型,作者直接采用的mask.bool,ciou = ( 1 - box_ciou( pred_boxes_for_ciou[mask.bool], t_box[mask.bool] ) ) * box_loss_scale[mask.bool]这个也是版本的问题,将pytorch版本换到1.2.0以上应该就可以解决,不过我的9.0版本的显卡最高也就只
2021-06-01 16:02:55 1266
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人