emnlp2017-bilstm-cnn-crf
emnlp2017-bilstm-cnn-crf copied to clipboard
TypeError: add_weight() got multiple values for argument 'name'
Hi there,
No matter which script I run, I get the same error in ChainCRF, i.e.,
Traceback (most recent call last): File "Train_POS.py", line 69, in <module> model.fit(epochs=25) File "/mnt/beegfs/home/thomas.haider/Documents/workspace/poetry/mtl/emnlp2017-bilstm-cnn-crf/neuralnets/BiLSTM.py", line 381, in fit self.buildModel() File "/mnt/beegfs/home/thomas.haider/Documents/workspace/poetry/mtl/emnlp2017-bilstm-cnn-crf/neuralnets/BiLSTM.py", line 210, in buildModel output = crf(output) File "/mnt/beegfs/home/thomas.haider/Documents/workspace/python36-venv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 75, in symbolic_fn_wrapper return func(*args, **kwargs) File "/mnt/beegfs/home/thomas.haider/Documents/workspace/python36-venv/lib/python3.6/site-packages/keras/engine/base_layer.py", line 463, in __call__ self.build(unpack_singleton(input_shapes)) File "/mnt/beegfs/home/thomas.haider/Documents/workspace/poetry/mtl/emnlp2017-bilstm-cnn-crf/neuralnets/keraslayers/ChainCRF.py", line 317, in build constraint=self.U_constraint) TypeError: add_weight() got multiple values for argument 'name'
Here is the full stacktrace:
(python36-venv) [thomas.haider@cn3-hpc emnlp2017-bilstm-cnn-crf]$ python Train_POS.py Using TensorFlow backend. Using existent pickle file: pkl/unidep_pos_komninos_english_embeddings.pkl --- unidep_pos --- 12543 train sentences 2002 dev sentences 2077 test sentences 2019-12-05 17:06:23.735125: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-12-05 17:06:23.746475: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2299880000 Hz 2019-12-05 17:06:23.748009: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x51156c0 executing computations on platform Host. Devices: 2019-12-05 17:06:23.748039: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): Host, Default Version 2019-12-05 17:06:23.751883: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 266775600 exceeds 10% of system memory. 2019-12-05 17:06:24.227171: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 266775600 exceeds 10% of system memory. 2019-12-05 17:06:25.572919: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 266775600 exceeds 10% of system memory. 2019-12-05 17:06:28.627543: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 266775600 exceeds 10% of system memory. LSTM-Size: [100] Traceback (most recent call last): File "Train_POS.py", line 69, in <module> model.fit(epochs=25) File "/mnt/beegfs/home/thomas.haider/Documents/workspace/poetry/mtl/emnlp2017-bilstm-cnn-crf/neuralnets/BiLSTM.py", line 381, in fit self.buildModel() File "/mnt/beegfs/home/thomas.haider/Documents/workspace/poetry/mtl/emnlp2017-bilstm-cnn-crf/neuralnets/BiLSTM.py", line 210, in buildModel output = crf(output) File "/mnt/beegfs/home/thomas.haider/Documents/workspace/python36-venv/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 75, in symbolic_fn_wrapper return func(*args, **kwargs) File "/mnt/beegfs/home/thomas.haider/Documents/workspace/python36-venv/lib/python3.6/site-packages/keras/engine/base_layer.py", line 463, in __call__ self.build(unpack_singleton(input_shapes)) File "/mnt/beegfs/home/thomas.haider/Documents/workspace/poetry/mtl/emnlp2017-bilstm-cnn-crf/neuralnets/keraslayers/ChainCRF.py", line 317, in build constraint=self.U_constraint) TypeError: add_weight() got multiple values for argument 'name'
I am running python 3.6 in a virtual environment on CentOS. I am on the newest versions of keras (2.3.1) and tensorflow (2.0). Should I downgrade?
Thanks, Thomas
Jap, turns out a downgrade to the requirements.txt did the trick.
Hey tnhaider..what exactly did you downgrade in requirements.txt as I am getting the exactly same error
Hi, I think I downgraded tensorflow.
From: Gourav Agrwal [mailto:[email protected]] Sent: Monday, March 23, 2020 8:35 PM To: UKPLab/emnlp2017-bilstm-cnn-crf [email protected] Cc: Haider, Thomas [email protected]; Author [email protected] Subject: Re: [UKPLab/emnlp2017-bilstm-cnn-crf] TypeError: add_weight() got multiple values for argument 'name' (#54)
Hey tnhaider..what exactly did you downgrade in requirements.txt as I am getting the exactly same error
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/UKPLab/emnlp2017-bilstm-cnn-crf/issues/54#issuecomment-602812318, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AG2OBLTUHDOFQ7JDTBHDFCTRI62XTANCNFSM4JV37OQA.
Hey tnhaider..what exactly did you downgrade in requirements.txt as I am getting the exactly same error
You just have to install the requirements. pip install -r requirements.txt
This solves it without downgrading package versions: https://github.com/EMBEDDIA/bert-bilstm-cnn-crf-ner/issues/1