Comments (4)
train len: 36064
test len: 5010
word2id len 4026
Creating the data generator ...
Finished creating the data generator.
begin to train...
Traceback (most recent call last):
File "train.py", line 108, in
model = Model(config,embedding_pre,dropout_keep=0.5)
File "/home/homework/proj/tensorflow/ChineseNER-master/tensorflow/bilstm_crf.py", line 20, in init
self._build_net()
File "/home/homework/proj/tensorflow/ChineseNER-master/tensorflow/bilstm_crf.py", line 57, in _build_net
self.viterbi_sequence, viterbi_score = tf.contrib.crf.crf_decode(bilstm_out, self.transition_params,tf.tile(np.array([self.sen_len]),np.array([self.batch_size])))
File "/home/homework/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/crf/python/ops/crf.py", line 537, in crf_decode
false_fn=_multi_seq_fn)
File "/home/homework/anaconda2/lib/python2.7/site-packages/tensorflow/python/layers/utils.py", line 206, in smart_cond
pred, true_fn=true_fn, false_fn=false_fn, name=name)
File "/home/homework/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/smart_cond.py", line 56, in smart_cond
return false_fn()
File "/home/homework/anaconda2/lib/python2.7/site-packages/tensorflow/contrib/crf/python/ops/crf.py", line 501, in _multi_seq_fn
sequence_length_less_one = math_ops.maximum(0, sequence_length - 1)
File "/home/homework/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/gen_math_ops.py", line 4602, in maximum
"Maximum", x=x, y=y, name=name)
File "/home/homework/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 546, in _apply_op_helper
inferred_from[input_arg.type_attr]))
TypeError: Input 'y' of 'Maximum' Op has type int64 that does not match type int32 of argument 'x'.谷歌也没搜出来解决办法,应该在哪加一个数据类型转换?
应该是你输入训练的y是int64类型的,模型里的placeholder设置的是int32,你改一个,统一一下就行了。
from chinesener.
请问能详细说一下怎么改吗 遇到了同样的问题
from chinesener.
我也遇到了同样的问题
from chinesener.
请问能详细说一下怎么改吗 遇到了同样的问题
你最后怎么改好的啊
from chinesener.
Related Issues (20)
- pytorch中运行train.py的问题 HOT 6
- “这篇文章” HOT 2
- 如果用來做part of the speech tagger 可以嗎?
- 关于pytorch BiLSTM_CRF模型中EMBEDDING_DIM和HIDDEN_DIM的设置 HOT 1
- 关于Pytorch版本中加入Batch
- 您好
- 博主您好
- 博主您好,想问您关于编码格式运行报错的问题,按照网上的方法改了很多次,还是出错。 HOT 1
- 博主您好,在eval.py中有一小句代码(tag='0' if tag=='O' else tag)看不太懂,博主您是否能解释一下呢。这里都把tag的值赋为0了为什么还要检测是不是为'O'呢?
- 关于 train2.pkl 中from compiler.ast import flatten的问题 HOT 1
- IOError: [Errno 2] No such file or directory: './model/model0.pkl' HOT 2
- 并发情况下,响应时间很慢
- 关系抽取 HOT 1
- pytorch版本模型测试代码 HOT 3
- 大佬谁能给一下tensorflow版本的运行步骤
- tensorflow版本处理数据问题
- 这种数据处理方法算是什么名字呢?
- pytorch pkl编码报错 HOT 3
- 更换Boson数据集pkl
- pytorch 和 tensorflow都是这行word2id = pickle.load(inp)报错
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chinesener.