- 博客(18)
- 资源 (1)
- 收藏
- 关注
原创 pytorch使用cuda报错RuntimeError: CUDA error: unknown error
pytorch使用cuda报错RuntimeError: CUDA error: unknown error加上torch.cuda.current_device()例如import osimport torchimport torch.nn as nnimport argparsefrom sklearn import metricsfrom torch.utils....
2019-12-17 19:40:13
4356
1
原创 将一个文件夹下面的所有text合并到一个CSV中
def read_txt(path,i): file = open(path,"rb") text = [] str = '' for line in file: line = line.decode().lower() str = str + line text.append(str) text.append...
2019-05-06 08:13:17
591
原创 将TXT转换成CSV
import reimport pandas as pdfile = open("C:/Users/zZ/Desktop/evsam2/evaltask2_sample_data/en_sample_data/sample.positive_short.txt","r")texts = []for line in file: text = [] index = line.f...
2019-05-05 20:46:41
5296
原创 ValueError: [E030] Sentence boundaries unset. You can add the 'sentencizer' component to the pipelin
错误代码:nlp = English()nlp.add_pipe(nlp.create_pipe('sentencizer'))def normalize(text): text = text.lower().strip() doc = nlp(text) filtered_sentences = [] for sentence in tqdm(doc.s...
2019-04-11 10:05:40
1695
1
原创 keras 多输入单输出 出现的问题ValueError: Error when checking model input: the list of Numpy arrays that you are
新手上路,文本分类中,我将一个文本用不同的嵌入得到不同的表示,代码如下#第一种嵌入sentence_input_pos = Input(shape=(MAX_TEXT_LENGTH,), dtype='int32')embedded_sequences_pos = embedding_layer_pos(sentence_input_pos)l_lstm_pos = Bidirec...
2019-03-21 14:38:16
16418
2
原创 TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int
Problem embed2 = TimeDistributed(Encoder1)(input2) File "E:\Python\Python36\lib\site-packages\keras\engine\topology.py", line 603, in __call__ output = self.call(inputs, **kwargs) File "E...
2018-11-13 09:10:09
8157
8
转载 Python类中的self
https://www.cnblogs.com/chownjy/p/8663024.htmlPython编写类的时候,每个函数参数第一个参数都是self,一开始我不管它到底是干嘛的,只知道必须要写上。后来对Python渐渐熟悉了一点,再回头看self的概念,似乎有点弄明白了。首先明确的是self只有在类的方法中才会有,独立的函数或方法是不必带有self的。self在定义类的方法时是必须有的...
2018-10-02 18:37:11
237
原创 Please use the NLTK Downloader to obtain the resource:
解决如下:原因在于缺少一个模块window 下 >>>python>>> import nltk>>> nltk.download('punkt')
2018-09-28 21:02:14
5380
5
转载 can't use a string pattern on a bytes-like object
Python 出现 can't use a string pattern on a bytes-like object# coding=utf-8 import urllib.request import re url = 'http://www.163.com' file = 'd:/test.html' data = urllib.request.urlopen(url).rea...
2018-09-28 20:54:44
335
原创 ImportError: cannot import name 'initializations'
In Keras 2.0, initializations was renamed (mirror) as initializers. You should therefore instead writefrom keras import initializers
2018-09-18 23:47:29
5360
原创 ImportError: cannot import name 'Merge'
ImportError: cannot import name 'Merge' 原因:Keras2.2版本貌似没有Merge这个东西解决:pip3 install --upgrade keras==2.1.0 升级到指定版本 2.1就有Merge
2018-09-18 23:44:59
7397
转载 TensorFlow图变量tf.Variable的用法解析
转自https://blog.youkuaiyun.com/gg_18826075157/article/details/78368924 两种定义图变量的方法1.tf.Variable2.tf.get_variable scope如何划分命名空间1. tf.variable_scope2. tf.name_scope...
2018-09-14 23:09:00
279
转载 SVM
机器之心已认证的官方帐号368 人赞同了该回答当处理文本分类问题时,你需要不断提炼自己的数据集,甚至会尝试使用朴素贝叶斯。在对数据集满意后,如何更进一步呢?是时候了解支持向量机(SVM)了:一种快速可靠的分类算法,可以在数据量有限的情况下很好地完成任务。在本文中,Bruno Stecanella 将对这一概念进行通俗易懂的解释,希望能对你有所帮助。或许你已经开始了自己的探索,听说过线性可分、核心技...
2018-07-09 10:42:40
1027
转载 windows10 64位系统,Python3.6环境下安装TensorFlow时报错,错误如下:
问题描述:windows10 64位系统,Python3.6环境下安装TensorFlow时报错,错误如下:.......... File "F:\软件\python3.6.1\lib\site-packages\pip\compat\__init__.py", line 75,in console_to_str return s.decode('utf_8')UnicodeDecodeE...
2018-07-07 17:43:22
896
转载 Word2vec
作者:穆文链接:https://zhuanlan.zhihu.com/p/26306795来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。1. 引子大家好我叫数据挖掘机皇家布鲁斯特大学肄业我喝最烈的果粒橙,钻最深的牛角尖——执着如我今天我要揭开Word2vec的神秘面纱直窥其本质相信我,这绝对是你看到的最浅白易懂的 Word2vec 中文总结(蛤?你问我为啥有这个底气...
2018-07-05 15:01:16
468
原创 VS
我的情况是这样的: 重装系统后安装VS2010 让后导入一个程序 运行就出现这个问题解决方案如下:1、单击红色部分 即 项目的属性2、点击 生成 出现下图3、选择 .net F 4就好了
2016-04-03 00:27:39
211
Python数据挖掘入门与实践
2017-10-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人