问题描述
我正在Azure中建立循环神经网络:
I am setting up my recurrent neural network in Azure:
model = Sequential()
model.add(GRU(units=512,
return_sequences=True,
input_shape=(None, x1,)))
model.add(Dense(y1, activation='sigmoid'))
但是我得到了错误:
TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'
我不是Cretin,但我相信我可能正在做的事情在当前版本的TensorFlow& Keras,如此示例一样,发生了类似的错误,并指出了此类错误出去.我正在Jupyter Azure平台中使用Python 3.6,这也意味着我不确定我正在使用哪个版本的Keras和TensoFlow.
I am not cretin but I believe I may be doing something that is now depreciated in current versions of TensorFlow & Keras, as in this example a similar error has occurred and such errors were pointed out. I am using Python 3.6 in the Jupyter Azure platform which also means I am unsure as to what version of Keras and TensoFlow I am using.
我完整的断网错误消息是:
My full tracback error message is:
TypeError Traceback (most recent call last)
<ipython-input-7-e6bcba2d0346> in <module>()
205 model.add(GRU(units=512, return_sequences=True,
--> 207 input_shape=(None,x1,)))
208
~/anaconda3_501/lib/python3.6/site-packages/keras/engine/sequential.py in add(self, layer)
164 # and create the node connecting the current layer
165 # to the input layer we just created.
--> 166 layer(x)
167 set_inputs = True
168 else:
~/anaconda3_501/lib/python3.6/site-packages/keras/layers/recurrent.py in __call__(self, inputs, initial_state, constants, **kwargs)
498
499 if initial_state is None and constants is None:
--> 500 return super(RNN, self).__call__(inputs, **kwargs)
501
502 # If any of `initial_state` or `constants` are specified and are Keras
~/anaconda3_501/lib/python3.6/site-packages/keras/engine/base_layer.py in __call__(self, inputs, **kwargs)
458 # Actually call the layer,
459 # collecting output(s), mask(s), and shape(s).
--> 460 output = self.call(inputs, **kwargs)
461 output_mask = self.compute_mask(inputs, previous_mask)
462
~/anaconda3_501/lib/python3.6/site-packages/keras/layers/recurrent.py in call(self, inputs, mask, training, initial_state)
1587 mask=mask,
1588 training=training,
-> 1589 initial_state=initial_state)
1590
1591 @property
~/anaconda3_501/lib/python3.6/site-packages/keras/layers/recurrent.py in call(self, inputs, mask, training, initial_state, constants)
607 mask=mask,
608 unroll=self.unroll,
--> 609 input_length=timesteps)
610 if self.stateful:
611 updates = []
~/anaconda3_501/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in rnn(step_function, inputs, initial_states, go_backwards, mask, constants, unroll, input_length)
2955 parallel_iterations=32,
2956 swap_memory=True,
-> 2957 maximum_iterations=input_length)
2958 last_time = final_outputs[0]
2959 output_ta = final_outputs[1]
TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'
我还从此教程WARNING:tensorflow:From keep_dims is deprecated, use keepdims instead
.如果这是有效的,我该怎么办?
I have also learned from this tutorial that WARNING:tensorflow:From keep_dims is deprecated, use keepdims instead
. If this is valid, how could I do this?
这也许有些直截了当,但是我很困惑,对此的帮助将不胜感激.
This maybe something quite straight forward but I am quite confused, Help with this would be really appreciated.
推荐答案
!pip uninstall keras
!pip install keras==2.1.2
现在可以了
这篇关于TypeError:while_loop()在Jupyter Azure中获得了意外的关键字参数'maximum_iterations'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!