- 博客(5)
- 收藏
- 关注
原创 记录一下深度学习坑(3): Expected all tensors to be on the same device, but found at least two devices, cuda:0
解决方法:将train模块里面一些比如model.cuda(),image.cuda(),mask.cuda()之类的,改为model.to(device),image.to(device),mask.to(device)。当然device在开头的时候要定义一下device = torch.device('cuda:1')我猜应该是.cuda默认就是cuda:0。
2023-07-07 18:28:48 411 1
原创 记录一下深度学习坑(2):Cannot load file containing pickled data when allow_pickle=False
参加一个kaggle比赛,里面数据是.npy文件,用np.load读取报错:Cannot load file containing pickled data when allow_pickle=False,然后再np.load中加入allow_pickle=True,就会报另一个错:OSError: Failed to interpret file 'XXX.npy' as a pickle。3.实在不行就删掉报错的数据吧,嘻嘻。2.在np.load中这样写。解决方法:1.装一下git lfs。
2023-07-07 17:50:46 3549
原创 记录一下深度学习坑(1):图片上采样
使用torch.nn.functional.interpolate时候需要转换一下图片的shape例如图片是(256,256,3,8),需要将其permute(2, 3, 0, 1)转成(3,8,256,256)才能用interpolate代码: images = torch.Tensor(images).permute(2, 3, 0, 1) images = torch.nn.functional.interpolate(images,scale_factor=2,
2023-07-05 15:50:08 73 1
原创 记录一下深度学习坑(0):Expected more than 1 value per channel when training, got input size torch.Size
(0)设置dataloader时加上drop_last = True。(1)改变batch_size大小。
2023-06-29 22:11:02 85
原创 关于r语言glmnet包“negative event times encountered; not permitted for Cox family”报错
r语言glmnet包的问题
2022-10-11 09:24:57 1740 7
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人