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

Apply tensorflow 2.0's v1 compatibility layer so the code works with TF2. #615

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mmohaveri
Copy link

The current master does not work with Tensorflow 2.0 because it's using a set of deprecated APIs.
This PR will replace those deprecated APIs with the ones from "tf.compat.v1".

@AndreaSottana
Copy link

Hi @mmohaveri
I have tried using your code. However, tf is not able to build the graph correctly, at least for me.
I have downloaded the BER model, I then open a terminal and run the following
bert-serving-start -model_dir=/d/Users/[...]/uncased_L-12_H-768_A-12 -cpu

But I then get the following error

Traceback (most recent call last):
  File "D:\Users\[...]\venv38\Scripts\bert-serving-start-script.py", line 33, in <module>
    sys.exit(load_entry_point('bert-serving-server', 'console_scripts', 'bert-serving-start')())
  File "d:\users\[...]\bert-as-service\server\bert_serving\server\cli\__init__.py", line 8, in main
    with BertServer(get_run_args()) as server:
  File "d:\users\[...]\bert-as-service\server\bert_serving\server\__init__.py", line 75, in __init__
    self.graph_path, self.bert_config = pool.apply(optimize_graph, (self.args,))
TypeError: cannot unpack non-iterable NoneType object

even though the Bert model is there. Any idea what might be going wrong?

@Akila-Ayanthi
Copy link

@AndreaSottana were you able to get it to work?

@Akila-Ayanthi
Copy link

Akila-Ayanthi commented Apr 14, 2021

@mmohaveri How do you run BAS from the source code?

@AndreaSottana
Copy link

@Akila-Ayanthi No I didn't, I suspect the original code from hanxiao:master (last commit August 2020) is not
regularly maintained and something might have broken due to version issues.
I am using this very good alternative though, to integrate BERT with ElasticSearch https://github.com/UKPLab/sentence-transformers/blob/master/examples/applications/semantic-search/semantic_search_quora_elasticsearch.py

@Akila-Ayanthi
Copy link

@AndreaSottana Thank you.

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

Successfully merging this pull request may close these issues.

3 participants