Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' #6

Closed
SeekPoint opened this issue Jul 7, 2018 · 10 comments

Comments

@SeekPoint
Copy link

(venv) mldl@mldlUB1604:~/ub16_prj/Named-Entity-Recognition-with-Bidirectional-LSTM-CNNs$ python3 nn.py
Using TensorFlow backend.
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties:
name: GeForce GTX 950M
major: 5 minor: 0 memoryClockRate (GHz) 1.124
pciBusID 0000:01:00.0
Total memory: 3.95GiB
Free memory: 3.56GiB
I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0
I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y
I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 950M, pci bus id: 0000:01:00.0)
Traceback (most recent call last):
File "nn.py", line 109, in
output = Bidirectional(LSTM(200, return_sequences=True, dropout=0.50, recurrent_dropout=0.25))(output)
File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/layers/wrappers.py", line 426, in call
return super(Bidirectional, self).call(inputs, **kwargs)
File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/engine/base_layer.py", line 460, in call
output = self.call(inputs, **kwargs)
File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/layers/wrappers.py", line 504, in call
y = self.forward_layer.call(inputs, **kwargs)
File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/layers/recurrent.py", line 2112, in call
initial_state=initial_state)
File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/layers/recurrent.py", line 609, in call
input_length=timesteps)
File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 2957, in rnn
maximum_iterations=input_length)
TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'

@kamalkraj
Copy link
Owner

kamalkraj commented Jul 7, 2018 via email

@SeekPoint
Copy link
Author

it works with right version

@davidalbertonogueira
Copy link

Keras 2.1.2
Tensorflow 1.4.1

It solved

@onurbarut
Copy link

I have the same problem. just installed keras using pip. keras 2.2.2 and tensorflow 1.3.0. is my tf causing this error? will updating to 1.4.1 help?

@sravyaysk
Copy link

Initially I am using Keras version 2.2.4 which resulted in the above issue. But when I downgraded my keras to version 2.1.2 as per the above mentioned solutions, it is resulting a new error:
ImportError: cannot import name 'normalize_data_format' while importing keras_contrib. For this error the solution states that keras_contrib works for keras with version 2.2.0 or higher.
Can anyone help in fixing this issue?

@mibdennis
Copy link

changed to the suggested versions but still the same error...

ameicler added a commit to ameicler/abnormal-spatiotemporal-ae that referenced this issue Dec 29, 2018
Otherwise [unexpected keyword argument 'maximum_iterations'](kamalkraj/Named-Entity-Recognition-with-Bidirectional-LSTM-CNNs#6)
`TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations'`
@Aishwaryabaskaran
Copy link

I downgraded keras to 2.0.8 and it is compatible with tensorflow 1.4

@YoungjaeKim
Copy link

I ended up by changing to cntk backend.

@xiaozhouliu
Copy link

keras 2.1.2, tensorflow 1.2.1.

@xieyj17
Copy link

xieyj17 commented Apr 25, 2019

Use Keras 2.1.2 Tensorflow 1.4.1

On Sat 7 Jul, 2018, 6:35 PM yk_data, @.***> wrote: (venv) @.***UB1604:~/ub16_prj/Named-Entity-Recognition-with-Bidirectional-LSTM-CNNs$ python3 nn.py Using TensorFlow backend. I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcublas.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcudnn.so.5 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcufft.so.8.0 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcuda.so.1 locally I tensorflow/stream_executor/dso_loader.cc:135] successfully opened CUDA library libcurand.so.8.0 locally W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations. W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations. I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:910] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero I tensorflow/core/common_runtime/gpu/gpu_device.cc:885] Found device 0 with properties: name: GeForce GTX 950M major: 5 minor: 0 memoryClockRate (GHz) 1.124 pciBusID 0000:01:00.0 Total memory: 3.95GiB Free memory: 3.56GiB I tensorflow/core/common_runtime/gpu/gpu_device.cc:906] DMA: 0 I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0: Y I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 950M, pci bus id: 0000:01:00.0) Traceback (most recent call last): File "nn.py", line 109, in output = Bidirectional(LSTM(200, return_sequences=True, dropout=0.50, recurrent_dropout=0.25))(output) File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/layers/wrappers.py", line 426, in call return super(Bidirectional, self).call(inputs, **kwargs) File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/engine/base_layer.py", line 460, in call output = self.call(inputs, **kwargs) File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/layers/wrappers.py", line 504, in call y = self.forward_layer.call(inputs, **kwargs) File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/layers/recurrent.py", line 2112, in call initial_state=initial_state) File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/layers/recurrent.py", line 609, in call input_length=timesteps) File "/home/mldl/ub16_prj/VENV_host/py3tf1.0/venv/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py", line 2957, in rnn maximum_iterations=input_length) TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#6>, or mute the thread https://github.com/notifications/unsubscribe-auth/AQTgmgLglOfTZted5UN--103tMgcw-CDks5uELIzgaJpZM4VGWms .

How should I thank you? It's like magic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants