Giter VIP home page Giter VIP logo

Comments (10)

bojone avatar bojone commented on August 30, 2024

keras 2.1.5 ~ keras 2.2.2均可。对应的最低的tf版本就行了。

from seq2seq.

 avatar commented on August 30, 2024

你好,请问你用的tf版本是多少?

from seq2seq.

bojone avatar bojone commented on August 30, 2024

tf 1.2、1.8、1.10都测试过~

from seq2seq.

 avatar commented on August 30, 2024

我用的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.

bojone avatar bojone commented on August 30, 2024

那只是因为你的keras版本太高,而tf版本过低...两者不配套。你把tf升级到1.8,或者自己修改一下tensorflow_backend.py,将tf.nn.softmax(x, axis=axis)改为tf.nn.softmax(x, axis)

from seq2seq.

 avatar commented on August 30, 2024

谢谢,刚好的问题解决了,但是还是出现下面这个问题,我用的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.

bojone avatar bojone commented on August 30, 2024

你有N卡么?装好对应的CUDA和CUDNN环境了?

from seq2seq.

 avatar commented on August 30, 2024

有的,我装的CUDA8.0

from seq2seq.

bojone avatar bojone commented on August 30, 2024

那我不清楚了,你可以考虑换回普通的LSTM,效果等价的

from seq2seq.

 avatar commented on August 30, 2024

好的,谢谢,我使用普通的可以跑通了

from seq2seq.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.