Comments (10)
keras 2.1.5 ~ keras 2.2.2均可。对应的最低的tf版本就行了。
from seq2seq.
你好,请问你用的tf版本是多少?
from seq2seq.
tf 1.2、1.8、1.10都测试过~
from seq2seq.
我用的tf1.3 报错?
Using TensorFlow backend.
Traceback (most recent call last):
File 'seq2seq.py', line 168, in
xy = Interact()([y, x, x_mask])
File '/export/gpudata/xiatianci/env/lib/python2.7/site-packages/keras/engine/base_layer.py', line 457, in call
output = self.call(inputs, **kwargs)
File 'seq2seq.py', line 159, in call
a = K.softmax(a)
File '/export/gpudata/xiatianci/env/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py', line 3154, in softmax
return tf.nn.softmax(x, axis=axis)
TypeError: softmax() got an unexpected keyword argument 'axis'
from seq2seq.
那只是因为你的keras版本太高,而tf版本过低...两者不配套。你把tf升级到1.8,或者自己修改一下tensorflow_backend.py,将tf.nn.softmax(x, axis=axis)改为tf.nn.softmax(x, axis)
from seq2seq.
谢谢,刚好的问题解决了,但是还是出现下面这个问题,我用的GPU去跑了,安装的tensorflow是cpu版本的
Caused by op u'cu_dnnlstm_3/CudnnRNN', defined at:
File 'seq2seq.py', line 135, in
y = CuDNNLSTM(char_size, return_sequences=True)(y)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/keras/layers/recurrent.py', line 500, in call
return super(RNN, self).call(inputs, **kwargs)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/keras/engine/base_layer.py', line 457, in call
output = self.call(inputs, **kwargs)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/keras/layers/cudnn_recurrent.py', line 90, in call
output, states = self._process_batch(inputs, initial_state)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/keras/layers/cudnn_recurrent.py', line 510, in _process_batch
is_training=True)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py', line 1546, in call
input_data, input_h, input_c, params, is_training=is_training)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py', line 1437, in call
seed=self._seed)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/tensorflow/contrib/cudnn_rnn/python/ops/cudnn_rnn_ops.py', line 926, in _cudnn_rnn
name=name)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/tensorflow/python/ops/gen_cudnn_rnn_ops.py', line 115, in cudnn_rnn
is_training=is_training, name=name)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py', line 787, in _apply_op_helper
op_def=op_def)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/tensorflow/python/framework/ops.py', line 3392, in create_op
op_def=op_def)
File '/export/gpudata/xiatianci/env/envs/bein/lib/python2.7/site-packages/tensorflow/python/framework/ops.py', line 1718, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'CudnnRNN' with these attrs. Registered devices: [CPU], Registered kernels:
[[Node: cu_dnnlstm_3/CudnnRNN = CudnnRNN[T=DT_FLOAT, direction='unidirectional', dropout=0, input_mode='linear_input', is_training=true, rnn_mode='lstm', seed=87654321, seed2=0](cu_dnnlstm_3/transpose, cu_dnnlstm_3/ExpandDims_1, cu_dnnlstm_3/ExpandDims_2, cu_dnnlstm_3/concat_1)]]
from seq2seq.
你有N卡么?装好对应的CUDA和CUDNN环境了?
from seq2seq.
有的,我装的CUDA8.0
from seq2seq.
那我不清楚了,你可以考虑换回普通的LSTM,效果等价的
from seq2seq.
好的,谢谢,我使用普通的可以跑通了
from seq2seq.
Related Issues (17)
- 请问数据集可以提供下载吗? HOT 1
- 请问训练数据里需要人工做标记么? HOT 1
- 苏神您好,关于IndexError: index 1 is out of bounds for axis 0 with size 1 HOT 4
- 您好,在训练时出现这个问题。An operation has `None` for gradient. Please make sure that all of your ops have a gradient defined (i.e. are differentiable). Common ops without gradient: K.argmax, K.round, K.eval. HOT 4
- 相同错误 IndexError: index 2 is out of bounds for axis 0 with size 2,gen_sent()函数中的_yr_id.append(list(yr_id[j]) + [r_arg_topk[j][k]+3])行,不知怎么回事,在完成第一个epoch后报错的!求助!多谢! HOT 3
- 数据问题
- 运行错误
- ValueError: Dimension must be 5 but is 4 for '{{node attention_11/transpose_4}} = Transpose[T=DT_FLOAT, Tperm=DT_INT32](attention_11/truediv, attention_11/transpose_4/perm)' with input shapes: [?,8,?,8,?], [4]. HOT 1
- 执行model.add_loss(cross_entropy)报错You must feed a value for placeholder tensor HOT 2
- 请问您用的是单个汉字还是词啊? HOT 2
- 您好,请问有数据吗 HOT 1
- 对比文章和代码后的两个疑问 HOT 4
- 请问你可以告知一下keras和tensorflow版本吗?
- 训练问题
- 大数据的处理问题 HOT 1
- python36跑不通 HOT 5
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 seq2seq.