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
loveJasmine opened this Issue Jul 7, 2018 · 7 comments

Comments

Projects
None yet
7 participants
@loveJasmine
Copy link

loveJasmine commented Jul 7, 2018

(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

This comment has been minimized.

Copy link
Owner

kamalkraj commented Jul 7, 2018

@loveJasmine

This comment has been minimized.

Copy link
Author

loveJasmine commented Jul 7, 2018

it works with right version

@davidalbertonogueira

This comment has been minimized.

Copy link

davidalbertonogueira commented Aug 3, 2018

Keras 2.1.2
Tensorflow 1.4.1

It solved

@onurbarut

This comment has been minimized.

Copy link

onurbarut commented Sep 5, 2018

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

This comment has been minimized.

Copy link

sravyaysk commented Nov 29, 2018

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

This comment has been minimized.

Copy link

mibdennis commented Dec 8, 2018

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

update tf and keras version
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

This comment has been minimized.

Copy link

Aishwaryabaskaran commented Feb 2, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.