Parallels Desktop虚拟机弹出激活失败解决教程
如果弹出下图所示内容,请直接下载15.1.2版本,覆盖安装; 如果是其他情况,继续往下看解决方法。 一、万能的重启; (软件重启, command+Q,强制退出,再打开) 二、彻底一点,手动添加hosts屏蔽 打开switchhosts,然 […]
联想笔记本UEA格式加密文件如何解密?
UEA格式的文件是联想笔记本的加密文件。利用的是指纹加密。如果你重装系统了,或者换电脑了,就打不开了。 不过如果你还记得当时的备份密码的话,还是有机会的。 这里需要利用一个名为“Protector suite”的软件,下载地址见文末。 下载 […]
Python爬虫中的万能过滤规则
经过初次爬虫得到的文本,里面很可能包含了大量的font、span等标签,用以下过滤规则可以很方便的对其进行过滤。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
def filter_tags(htmlstr): # 先过滤CDATA re_cdata = re.compile('//<!\[CDATA\[[^>]*//\]\]>', re.I) # 匹配CDATA re_script = re.compile('<\s*script[^>]*>[^<]*<\s*/\s*script\s*>', re.I) # Script re_style = re.compile('<\s*style[^>]*>[^<]*<\s*/\s*style\s*>', re.I) # style re_br = re.compile('<br\s*?/?>') # 处理换行 re_h = re.compile('</?\w+[^>]*>') # HTML标签 re_comment = re.compile('<!--[^>]*-->') # HTML注释 s = re_cdata.sub('', htmlstr) # 去掉CDATA s = re_script.sub('', s) # 去掉SCRIPT s = re_style.sub('', s) # 去掉style s = re_br.sub('\n', s) # 将br转换为换行 s = re_h.sub('', s) # 去掉HTML 标签 s = re_comment.sub('', s) # 去掉HTML注释 # 去掉多余的空行 blank_line = re.compile('\n+') s = blank_line.sub('\n', s) s = replaceCharEntity(s) # 替换实体 return s def replaceCharEntity(htmlstr): CHAR_ENTITIES = {'nbsp': ' ', '160': ' ', 'lt': '<', '60': '<', 'gt': '>', '62': '>', 'amp': '&', '38': '&', 'quot': '"', '34': '"', } re_charEntity = re.compile(r'&#?(?P<name>\w+);') sz = re_charEntity.search(htmlstr) while sz: entity = sz.group() # entity全称,如> key = sz.group('name') # 去除&;后entity,如>为gt try: htmlstr = re_charEntity.sub(CHAR_ENTITIES[key], htmlstr, 1) sz = re_charEntity.search(htmlstr) except KeyError: # 以空串代替 htmlstr = re_charEntity.sub('', htmlstr, 1) sz = re_charEntity.search(htmlstr) return htmlstr |
使用的时候也很简单,只需要: [crayon-686d0ea […]
/pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.
使用colab进行训练时出现如下问题:
1 2 3 4 5 6 7 8 9 10 11 |
/usr/local/lib/python3.6/dist-packages/mmcv/runner/epoch_based_runner.py:181: UserWarning: Runner was deprecated, please use EpochBasedRunner instead 'Runner was deprecated, please use EpochBasedRunner instead') /usr/local/lib/python3.6/dist-packages/mmcv/runner/base_runner.py:63: UserWarning: batch_processor is deprecated, please implement train_step() and val_step() in the model instead. warnings.warn('batch_processor is deprecated, please implement ' 2020-09-29 03:25:25,281 - mmdet - INFO - Start running, host: root@06ffd23f9f49, work_dir: 2020-09-29 03:25:25,281 - mmdet - INFO - workflow: [('train', 1)], max: 24 epochs /pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. /pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. /pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. /pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. /pytorch/aten/src/ATen/native/IndexingUtils.h:20: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead. |
经查,是pytorch版本的问题,当pytorch版本改为1.1.0时,该问题消失,如果对pytorch版本有要求,可以在train. […]
unable to load the nvidia-drm kernel module
出现原因: 使用run文件已经安装驱动前提下,重新使用apt安装了一遍,导致登陆无限循环以及无法使用GPU。 如果出现下面这个,是因为目前有图形界面在使用,关闭即可。
1 2 3 4 |
This may be because it is in use (for example, by an X server, a CUDA program, or the NVIDIA Persistence Daemon), but this may also happen if your kernel was configured without support for module unloading. Please be sure to exit any programs that may be using the GPU(s) before attempting to upgrade your driver. If no GPU-based programs are running, you know that your kernel supports module unloading, and you still receive this message, then an error may have occured that has corrupted an NVIDIA kernel module's usage count, for which the simplest remedy is to reboot your computer. |
然后安 […]
RuntimeError: No such operator torchvision::nms
遇到问题:
1 2 3 4 5 6 7 8 9 10 11 12 |
Traceback (most recent call last): File "efficientdet_test.py", line 79, in <module> threshold, iou_threshold) File "/home/ubuntu/bigdisk/part1/Yet-Another-EfficientDet-Pytorch/utils/utils.py", line 109, in postprocess anchors_nms_idx = batched_nms(transformed_anchors_per, scores_per[:, 0], classes_, iou_threshold=iou_threshold) File "/home/ubuntu/.conda/envs/efficientdetpytorch/lib/python3.6/site-packages/torchvision/ops/boxes.py", line 76, in batched_nms keep = nms(boxes_for_nms, scores, iou_threshold) File "/home/ubuntu/.conda/envs/efficientdetpytorch/lib/python3.6/site-packages/torchvision/ops/boxes.py", line 36, in nms return torch.ops.torchvision.nms(boxes, scores, iou_threshold) File "/home/ubuntu/.conda/envs/efficientdetpytorch/lib/python3.6/site-packages/torch/_ops.py", line 61, in __getattr__ op = torch._C._jit_get_operation(qualified_op_name) RuntimeError: No such operator torchvision::nms |
解决: pip install torch==1.3.0 pip install torchvision==0.4.1 若无法解决欢迎留言,我看到回复。 本文最后 […]
关于ROC和AUC的个人理解
这几天看论文,看到了一个评价指标:AUC。之前面对的都是mAP,或者TP/FP这种,对AUC没有太深的了解,就趁这个机会巩固一下关于AUC的相关内容。首先来看一张图: 这个就是大名鼎鼎的ROC曲线,而AUC就是这个曲线与X轴的面积。首先结论 […]
Mac下快速删除指定文件夹下的.DS_Store文件
最近被.DS_Store文件烦死了,这个文件是自动生成的,基本上每个文件夹下都会有。主要是记录了当前目录下文件的排列、缩略图设置等。 不过在Python下批量操作文件的时候,老是把它也加进去,导致报错。索性全删掉!命令如下: find “/ […]
Github加速
推荐当简单方法不能用的时候,再使用复杂方法。我这边实测GitHub clone的速度能到2M/s 简单方法: 打开本地的hosts,然后填入:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# Github 151.101.44.249 github.global.ssl.fastly.net 140.82.112.4 github.com 103.245.222.133 assets-cdn.github.com 23.235.47.133 assets-cdn.github.com 203.208.39.104 assets-cdn.github.com 185.199.108.153 assets-cdn.github.com 185.199.109.153 assets-cdn.github.com 185.199.110.153 assets-cdn.github.com 185.199.111.153 assets-cdn.github.com 204.232.175.78 documentcloud.github.com 199.232.68.133 avatars2.githubusercontent.com 204.232.175.94 gist.github.com 107.21.116.220 help.github.com 207.97.227.252 nodeload.github.com 192.30.253.121 codeload.github.com 199.27.76.130 raw.github.com 107.22.3.110 status.github.com 204.232.175.78 training.github.com 207.97.227.243 www.github.com 199.232.69.194 github.global.ssl.fastly.net 185.31.18.133 avatars0.githubusercontent.com 185.31.19.133 avatars1.githubusercontent.com |
OK! 复杂点的方法: 打开这 […]
百度的海外网盘dubox来了,免费1T,不限速。不过:国内无法使用。
最近百度云的海外网盘Dubox来了,号称是不限速网盘,我这边测试了下,上传速度能到10M/s,下载速度也能达到3.3M/s。 有兴趣的可以试试:https://www.dubox.com/ 不过很遗憾的是,国内无法使用,如果检测到国内IP, […]