
笔记
qingjuanzhao
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
AttributeError: ‘str‘ object has no attribute ‘size‘
batch_size = key.size(0)transformers 版本不对。原创 2021-07-06 10:37:54 · 4492 阅读 · 0 评论 -
RuntimeError: CUDA out of memory. Tried to allocate 96.00 MiB (GPU 0; 15.75 GiB total capacity; 14.3
RuntimeError: CUDA out of memory. Tried to allocate 96.00 MiB (GPU 0; 15.75 GiB total capacity; 14.39 GiB already allocated; 51.50 MiB free; 14.71 GiB reserved in total by PyTorch)把batch_size 设置小一点的数。原创 2021-07-06 10:35:00 · 1233 阅读 · 0 评论 -
pytorch 安装不上,包冲突
python版本不对。重装了anaconda之后就好了,历史版本下载链接如下。https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/安装如下原创 2021-06-10 09:47:12 · 4560 阅读 · 0 评论 -
pytorch tensorboard使用
tensorboard --logdir=models提示tensorboard 1.15.0 at。 localhost:6006即说明可以显示。原创 2021-03-29 15:32:23 · 136 阅读 · 0 评论 -
linux 创建文件夹,新建文件
创建文件夹 mkdir aaa新建文件 touch aaa.txt bbb.txt原创 2021-03-29 15:06:48 · 944 阅读 · 0 评论 -
pip install 问题汇总:1. 安装tensorflow-gpu错误。
1. 安装tensorflow-gpu==1.15.0时,出现错误ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.解决办法:pip install wrapt --ignore-...原创 2021-03-27 21:44:55 · 1185 阅读 · 0 评论 -
查看文档有多少行,查看前十行
一些简单有用命令1.查看文档的前几行,尤其是非常大的文档,不用加载完。head -5 aaa.txt 查看文档的前五行。原创 2021-03-23 16:44:46 · 1472 阅读 · 0 评论 -
pip install transformers. ERROR: No matching distribution found for trasformers
ERROR: Could not find a version that satisfies the requirement trasformersERROR: No matching distribution found for trasformers解决办法:pip install transformers -i https://pypi.python.org/simple原创 2021-03-22 18:13:50 · 7395 阅读 · 2 评论 -
ROUG安装配置,终于在两台linux和一台Mac上成功安装ROUGE,完美解决各种问题
记录下安装教程以及安装中遇到的问题。首先在linux上安装,一、如网上资料所说,安装要求如下: 1. 需要安装perl解释器(ubuntu 系统已自带, 通过perl -v可查看当前版本); 2. 需要额外安装perl解释器的XML::DOM模块以及DB_File模块,而XML::DOM的安装又需要XML::RegExp、XML::Parser、LWP::UserAgent和XML::Parser::PerlSAX模块(对,就是这么恶心); 3. 设置系统环境变量ROUGE...原创 2020-05-12 15:26:03 · 1530 阅读 · 1 评论 -
python判断字符串包含中文、数字、英文
1.判断字符串只包含中文:#encoding=utf-8import sysreload(sys)sys.setdefaultencoding('utf8')def check_contain_chinese(check_str): flag = True for ch in check_str.decode('utf-8'): if u'\u4e00' ...原创 2018-04-12 10:51:18 · 19890 阅读 · 0 评论 -
python读写txt文件、csv文件
1. text读写(1)读stopwords = {}.fromkeys([line.rstrip() for line in open('./data/stopwords.txt')]) for line in open("./feature/ntusd-negative.txt"):(2)写 fou=open('./data/wiki_newwords.txt','...原创 2018-04-11 18:16:21 · 467 阅读 · 0 评论 -
python可视化
# 可视化# 二维import matplotlib.pyplot as pltplt.scatter(data[:,0],data[:,1],c=labels)plt.show()# 三维import matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dfig = plt.figure()ax = fig.add_subp...原创 2018-04-11 18:03:41 · 355 阅读 · 0 评论 -
python入门安装
1.下载python2.7 (官网)2.环境配置添加python安装路径到系统环境path下 C:\Python273.下载pycharm(安装)4.easy_insatall 和pip安装easy_install和pip都是用来下载安装Python一个公共资源库PyPI的相关资源包的首先安装easy_install下载地址:https://pypi.python.org/pypi/ez_set...原创 2018-04-11 18:02:21 · 217 阅读 · 0 评论 -
多个python版本共存问题
1.指定某个版本的Python运行程序:去手动把 python27下面的python.exe改成python2.exe(改个名称)python35下面的python.exe改成python3.exe命令行运行时,python2 即可进入python2.7的环境。如果在集成端可以指定python版本,或者在代码最前边指定#! D:\python27\python2.exe。2.指定某个版本的py...原创 2018-04-11 17:57:05 · 305 阅读 · 0 评论 -
python 常用
1.数据读取:#方法一:对网页直接进行读取# content = urllib2.urlopen(urllib2.Request("http://pythonscraping.com/files/inaugurationSpeech.txt")).read()#方法二:对本地文件的读取,测试时候用,因为无需联网# content = open("data\\English.txt").read()...原创 2018-04-11 17:58:53 · 155 阅读 · 0 评论