SiameseSentenceSimilarity icon indicating copy to clipboard operation
SiameseSentenceSimilarity copied to clipboard

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

Open SeekPoint opened this issue 6 years ago • 2 comments

ub16hp@UB16HP:/media/ub16hp/WINDOWS/ub16_prj/liuhuanyong/SiameseSentenceSimilarity$ sudo pip3.5 install keras==2.2.4 The directory '/home/ub16hp/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/ub16hp/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Looking in indexes: https://mirrors.aliyun.com/pypi/simple Requirement already satisfied: keras==2.2.4 in /usr/local/lib/python3.5/dist-packages (2.2.4) Requirement already satisfied: keras-applications>=1.0.6 in /usr/local/lib/python3.5/dist-packages (from keras==2.2.4) (1.0.6) Requirement already satisfied: numpy>=1.9.1 in /usr/local/lib/python3.5/dist-packages (from keras==2.2.4) (1.14.0) Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.5/dist-packages (from keras==2.2.4) (1.0.5) Requirement already satisfied: scipy>=0.14 in /usr/local/lib/python3.5/dist-packages (from keras==2.2.4) (1.0.0) Requirement already satisfied: pyyaml in /usr/local/lib/python3.5/dist-packages (from keras==2.2.4) (3.13) Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.5/dist-packages (from keras==2.2.4) (1.11.0) Requirement already satisfied: h5py in /usr/local/lib/python3.5/dist-packages (from keras==2.2.4) (2.8.0) ub16hp@UB16HP:/media/ub16hp/WINDOWS/ub16_prj/liuhuanyong/SiameseSentenceSimilarity$ python3.5 siamese_model.py Using TensorFlow backend. /home/ub16hp/.local/lib/python3.5/site-packages/requests/init.py:80: RequestsDependencyWarning: urllib3 (1.24.1) or chardet (3.0.4) doesn't match a supported version! RequestsDependencyWarning) 100000 100000 average_length: 11.68037 max_length: 25 Found 20028 word vectors. [[0] [0] [0] ... [1] [1] [0]] Traceback (most recent call last): File "siamese_model.py", line 242, in handler.train_model() File "siamese_model.py", line 186, in train_model model = self.bilstm_siamese_model() File "siamese_model.py", line 166, in bilstm_siamese_model shared_lstm = self.create_base_network(input_shape=(self.TIME_STAMPS, self.EMBEDDING_DIM)) File "siamese_model.py", line 145, in create_base_network lstm1 = Bidirectional(LSTM(128, return_sequences=True))(input) File "/usr/local/lib/python3.5/dist-packages/keras/layers/wrappers.py", line 427, in call return super(Bidirectional, self).call(inputs, **kwargs) File "/usr/local/lib/python3.5/dist-packages/keras/engine/base_layer.py", line 457, in call output = self.call(inputs, **kwargs) File "/usr/local/lib/python3.5/dist-packages/keras/layers/wrappers.py", line 522, in call y = self.forward_layer.call(inputs, **kwargs) File "/usr/local/lib/python3.5/dist-packages/keras/layers/recurrent.py", line 2194, in call initial_state=initial_state) File "/usr/local/lib/python3.5/dist-packages/keras/layers/recurrent.py", line 649, in call input_length=timesteps) File "/usr/local/lib/python3.5/dist-packages/keras/backend/tensorflow_backend.py", line 3011, in rnn maximum_iterations=input_length) TypeError: while_loop() got an unexpected keyword argument 'maximum_iterations' ub16hp@UB16HP:/media/ub16hp/WINDOWS/ub16_prj/liuhuanyong/SiameseSentenceSimilarity$

SeekPoint avatar Feb 09 '19 17:02 SeekPoint

Use keras == 2.1.2

lxz1992 avatar May 22 '19 07:05 lxz1992

请问 tensorflow 版本号是多少啊?

penngao avatar Jul 18 '20 07:07 penngao