自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 收藏
  • 关注

原创 ERROR:输入: conda activate xxx

报错CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.解决办法:source activatesource deactivate再次执行 conda activate XXX 不再出现问题

2021-10-21 16:45:14 156

原创 LATEX algorithm总跑到最后一页(爱思唯尔模板),或者过长,分页显示

添加如下命令到导入包区\usepackage{algorithm}\usepackage{algorithmic}\renewcommand{\algorithmicrequire}{ \textbf{Input:}} %Use Input in the format of Algorithm\renewcommand{\algorithmicensure}{ \textbf{Output:}} %UseOutput in the format of Algorithm\usepacka..

2021-10-09 09:57:20 2780

原创 ERROR: Cannot uninstall ‘wrapt‘.

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.wrapt包已经存在。下载tensorflow时忽略wrap包。pip install -U --ignore-installed wra

2021-07-06 15:41:45 260

原创 ModuleNotFoundError: No module named ‘transformers.models‘

升级 transformers, pip installtransformers==3.4.0

2021-07-06 14:53:12 9739 2

原创 AttributeError: ‘str‘ object has no attribute ‘size‘

batch_size = key.size(0)transformers 版本不对。

2021-07-06 10:37:54 4009

原创 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 1114

原创 pytorch 安装不上,包冲突

python版本不对。重装了anaconda之后就好了,历史版本下载链接如下。https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/安装如下

2021-06-10 09:47:12 4011

转载 pycharm——预设python文件开头的作者时间信息

原来不止我想要这种花里胡哨的东西。就是这种效果:设置在这里:PyCharm-->Preferences-->Editor-->File and Code Templates-->Python Script-->填写这些文字:# !/usr/bin/env python3# -*- coding: utf-8 -*-# @Time : ${DATE} ${TIME}# @Author : name# @Email : email# @Fil.

2021-03-31 19:07:41 471

原创 pytorch tensorboard使用

tensorboard --logdir=models提示tensorboard 1.15.0 at。 localhost:6006即说明可以显示。

2021-03-29 15:32:23 90

原创 linux 创建文件夹,新建文件

创建文件夹 mkdir aaa新建文件 touch aaa.txt bbb.txt

2021-03-29 15:06:48 853

原创 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 1042

原创 查看文档有多少行,查看前十行

一些简单有用命令1.查看文档的前几行,尤其是非常大的文档,不用加载完。head -5 aaa.txt 查看文档的前五行。

2021-03-23 16:44:46 1229

原创 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 4471 1

原创 升级及安装显卡驱动,安装cuda

一:根据显卡和系统选择合适驱动去英伟达官网下载驱动程序(http://www.nvidia.cn/Download/index.aspx?lang=cn)二:执行命令:lsmod | grep nouveau禁用X服务:sudo /etc/init.d/lightdm stop (或者:sudo service lightdm stop)给驱动run文件赋予可执行权限:sudo chmod a+x NVIDIA-Linux-x86_64-418.126.02.run ...

2020-05-27 00:18:58 1306

原创 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 1335 1

原创 ubuntu中打开vim出现错误:/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0: undefined symbol: XML_SetHashSalt

ubuntu中打开vim出现错误:/usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0: undefined symbol: XML_SetHashSalt不知道操作了啥之后vim不能用了,网上搜罗一大圈,找到解决方案:参考链接。https://blog.csdn.net/J_H_C/article/details/84961219很久没有...

2020-05-06 17:39:26 2254

原创 import torch 报错,from torch._C import * ImportError: dlopen.... Reason: image not found

电脑MacBookpro python3.7pip 安装pytorch后,import torch报错from torch._C import *ImportError: dlopen.... Reason: image not found网上各种搜索着解决方案,最终使用如下命令成功解决:brew install libomp本人使用其他方法均为解决...

2020-04-29 15:43:56 900 1

转载 UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte解决办法

原文链接https://blog.csdn.net/qq_34149581/article/details/83418047Mac OS上使用Python3读取文件过程中出现了UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 3131: invalid start byte情况。原因是:OS X系...

2020-04-17 16:54:02 2014 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 19581

原创 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 374

原创 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 304

原创 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 181

原创 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 115

原创 多个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 258

原创 python实现中文依存句法分析

需求:python实现中文依存句法分析(最初尝试了NLTK库来实现,发现只能实现英文,不能应用中文场景)方法一、斯坦福依存句法分析处理中文斯坦福依存句法分析参考教程地址:https://blog.csdn.net/guolindonggld/article/details/72795022安装stanfordcorenlp包之前: 1:下载安装JDK 1.8及以上版本。 2:下载Stanford ...

2018-04-11 17:52:34 19097 7

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除