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: add_weight() got multiple values for argument 'name' #54

Open
tnhaider opened this issue Dec 5, 2019 · 5 comments
Open

TypeError: add_weight() got multiple values for argument 'name' #54

tnhaider opened this issue Dec 5, 2019 · 5 comments

Comments

@tnhaider
Copy link

tnhaider commented Dec 5, 2019

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

@tnhaider
Copy link
Author

tnhaider commented Dec 5, 2019

Jap, turns out a downgrade to the requirements.txt did the trick.

@Gouraviitk
Copy link

Hey tnhaider..what exactly did you downgrade in requirements.txt as I am getting the exactly same error

@tnhaider
Copy link
Author

tnhaider commented Mar 23, 2020 via email

@tnhaider
Copy link
Author

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

@spacemonqi
Copy link

This solves it without downgrading package versions: EMBEDDIA/bert-bilstm-cnn-crf-ner#1

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

3 participants