Bert-as-service: On Windows: FileNotFoundError: graph optimization fails and returns empty result

Created on 20 Jan 2019  ·  13Comments  ·  Source: hanxiao/bert-as-service

Prerequisites

I'm using this command to start the server:

python bert-serving-start -model_dir=../../pre-trained-model/

Then this issue shows up:
image

bug

All 13 comments

I had the same issue (Win 10). What fixed it for me was to comment out two lines of logger code in the /server/graph.py file.

logger.info("freezing %d variables...", len(returned_variables))

logger.info("Converted %d variables to const ops.", how_many_converted) 

Could you do bert-serving-start -version and tell me your version? as I already solved the logger issue on Windows in #183 and shouldn't be any problem since 1.7.0.

Please do pip install -U bert-serving-server bert-serving-client and upgrade to the latest version and retry.

My version is 1.7.5

@davidlenz it works! thx!

I'm reopening this as a bug.

I also have the same issue,

  • Windows 10
  • tf version 1.12.0 (conda tensorflow-gpu venv)
  • Same issue with and without -cpu flag
  • Python version 3.6.8
  • bert-serving-start -version gives: 1.7.4, upgraded now to 1.7.5 but the result is the same.

UPDATE: @davidlenz solution seems to work (tested with GPU)

Somehow my logger mysteriously fails on Windows for this particular part. I did a quick fix, could you please give a try on 1.7.6 using pip install -U?

@hanxiao, thanks for the update. Unfortunately I get the same error with 1.7.6, and it is again fixed by commenting out the logger lines 194 and 248 in graph.py.

🤦‍♂️

Instead of bumping versions, I'd keep it as it is for now. In the next version, I will remove logger in graph.py for better compatibility on Windows. For all windows users, if you encounter such problem, please refer to the quick fix as https://github.com/hanxiao/bert-as-service/issues/207#issuecomment-455890549 suggested. Meanwhile stay tuned.

I also got this problem. My version is 1.7.6, os is win7 .

fyi, this is fixed in #212, the new feature is available since 1.7.7. Please do

pip install -U bert-serving-server bert-serving-client

for the update.

I encountered this problem again in version 1.8.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhant09 picture zhant09  ·  3Comments

kirdin picture kirdin  ·  3Comments

loretoparisi picture loretoparisi  ·  6Comments

shashi-netra picture shashi-netra  ·  3Comments

un-lock-me picture un-lock-me  ·  3Comments