令人崩溃的坑
onlyforbest
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
浏览器被毒霸劫持
参看:谷歌首页被毒霸劫持解决办法_小兵的博客-优快云博客一觉醒来,浏览器首页就被篡改了,这也太恶心了。卸载驱动精灵,回想这几天弹出的各种新闻、广告。想想都恶心。真是无良软件。...原创 2021-09-23 07:06:56 · 277 阅读 · 0 评论 -
pandas isnull dropna使用,返回dropna,isnull的空值
dataframe 结构features = features.dropna(axis=0) 去除空行为了了解dropna删除的数据,做如下的判断。按行检查,返回出现NaN的列features.isnull().any(axis = 0)取出目标空值数据:这里需要注意的是切片所取的维度features.iloc[:,features.isnull().any(axis = 0).values==True]按列检查,返回出现NaN的行f...原创 2021-08-18 21:24:43 · 342 阅读 · 0 评论 -
pandas.datetime 将要移除
FutureWarning: The pandas.datetime class is deprecated and will be removed from pandas in a future version. Import from datetime instead.解决方法 安装 datetime包pip install datetimedatetime 函数调用示例对比#pandas中调用datetimepd.datetime.strptime('2019-01-01 00原创 2021-08-18 20:15:07 · 4691 阅读 · 0 评论 -
pip 升级误删pip ,添加环境变量仍不能解决
参考:(20条消息) python3 缺少PIP解决办法_Huo的藏经阁的博客-优快云博客使用下面的命令安装pippython -m ensurepip --default-pip原创 2021-08-18 19:37:47 · 281 阅读 · 0 评论 -
“floor“ “_vml_cpu“ not implemented for ‘Long‘
target=torch.tensor([[ [39, 4, 1], [57, 80, 1], [80, 100,2], [55, 60, 3]]])print(target.dtype)'''tensor内部全是正数默认是torch.int64 为long 长整型floor 只能对浮点型数据进行操作,可以进行如下操作避免。target=target.float().原创 2021-06-16 10:32:18 · 1566 阅读 · 0 评论 -
torch.where 防止空操作,避免loss 计算出现nan
import torchy=torch.tensor([1,0])x=torch.tensor([[1,2,3],[1,23,4]])print(x[torch.where(y>10)])diff=x[torch.where(x>100)]''' 通过求和 无法解决高维度的空张量 tensor([], size=(0, 3), dtype=torch.int64)'''y=sum(torch.tensor([[[]]]))print(y)''' 可以先取出张量的数据,再通过.原创 2021-04-22 10:14:56 · 852 阅读 · 0 评论 -
使用多分类交叉熵损失 。报错:RuntimeError: expected scalar type Long but found Float
import torchx=torch.Tensor([[0.5000, 0.5003, 0.5011, 0.5003, 0.5000, 0.5006], [0.5000, 0.5003, 0.5010, 0.5003, 0.5000, 0.5006], [0.5000, 0.5003, 0.5011, 0.5003, 0.5000, 0.5006], [0.5000, 0.5003, 0.5010, 0.5004, 0.5000, 0.5005],...原创 2021-03-13 11:39:08 · 7956 阅读 · 0 评论 -
关于修改loss函数,以及loss为nan的一些情况
1、代码中使用到了torch.sqrt ,如果sqrt的输入参数为负数,那么也会导致计算的结果为nan,最终导致loss函数出现nan。2、输入参数过小torch.sqrt就算结果趋近于0,遇到有log的对数函数计算时候,会出现无穷大的情况。3、还有就是参数过小,趋近于0,反向传播时候作为分母,造成反向计算的节点为无穷大。4、做归一化操作时,同组数据为0,造成分母为0(最大值-最小值)。第一种情况,个人采用的解决方法是,将网络的输出使用relu函数将结果取正。后面三种情况,总结来说.原创 2021-03-13 10:19:12 · 842 阅读 · 0 评论 -
pyspark 快速安装
1、先安装incremental (建议将工具包下载下来,然后在本地安装 可用镜像源地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/)2、安装pyspark 试了一下豆瓣有这个镜像源pip install incremental==17.5.0pip install pyspark -i http://pypi.douban.com/simple --trusted-host pypi.douban.com...原创 2021-01-16 20:47:05 · 820 阅读 · 0 评论 -
RuntimeError: CUDA out of memory. Tried to allocate 2.81 GiB (GPU 0; 14.73 GiB total capacity; 12.38
try: outputs = (model(train_datas)).cuda() except RuntimeError as exception: if "out of memory" in str(exception): print("WARNING: out of memory") if hasattr(torch.cuda, 'empty_cac...原创 2020-12-03 20:24:56 · 597 阅读 · 2 评论 -
torch._C._cuda_init() RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected
1、一个月不用云服务器就报了个大错(整个人都不好了,之前还用的好好的,现在就凉了): torch._C._cuda_init()RuntimeError: cuda runtime error (38) : no CUDA-capable device is detected at /pytorch/aten/src/THC/THCGeneral.cpp:502、寻找解决方法:第一篇参考博客:https://blog.youkuaiyun.com/hangzuxi8764/article/d原创 2020-10-18 16:53:04 · 8003 阅读 · 0 评论
分享