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: cannot unpack non-iterable NoneType object #278

Closed
4 tasks done
KODGV opened this issue Mar 16, 2019 · 8 comments
Closed
4 tasks done

TypeError: cannot unpack non-iterable NoneType object #278

KODGV opened this issue Mar 16, 2019 · 8 comments

Comments

@KODGV
Copy link

KODGV commented Mar 16, 2019

Prerequisites

Please fill in by replacing [ ] with [x].

System information

Some of this information can be collected via this script.

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):windows10
  • TensorFlow installed from (source or binary):
  • TensorFlow version:1.13.0
  • Python version:3.7
  • bert-as-service version: latest
  • GPU model and memory: 2080 8G
  • CPU model and memory: AMD 40G

Description

Please replace YOUR_SERVER_ARGS and YOUR_CLIENT_ARGS accordingly. You can also write your own description for reproducing the issue.

I'm using this command to start the server:

bert-serving-start -model_dir D:\chinese_L-12_H-768_A-12\ -num_worker=4

Then this issue shows up:
image

Traceback (most recent call last):
File "c:\users\kodgv\anaconda3\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "c:\users\kodgv\anaconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\KODGV\Anaconda3\Scripts\bert-serving-start.exe_main
.py", line 9, in
File "c:\users\kodgv\anaconda3\lib\site-packages\bert_serving\server\cli_init
.py", line 5, in main
server = BertServer(args)
File "c:\users\kodgv\anaconda3\lib\site-packages\bert_serving\server_init_.py", line 70, in init
self.graph_path, self.bert_config = pool.apply(optimize_graph, (self.args,))
TypeError: cannot unpack non-iterable NoneType object

i'm using the full path of the files

@KODGV
Copy link
Author

KODGV commented Mar 17, 2019

it seems there may be some problems with the latest tensorflow version. i downgrade tensorflow-gpu==1.12.0 to fix the problem.

@KODGV KODGV closed this as completed Mar 17, 2019
@NidhiRustagi
Copy link

Updated the latest version of Tensorflow and have given absolute path still the same error

@rowhitswami
Copy link

For those who are on a CPU:
Follow these two steps if you're getting the same error.

  1. pip uninstall current_version_of_tf
  2. pip install tensorflow==1.13.0rc1

@KODGV
Copy link
Author

KODGV commented Jul 15, 2020

在lib\bert_serving\server\graph.py 中引入
import traceback方法,
在150行(except Exception :后面)插入语句traceback.print_exc()。重新运行,打印出配置失败的原因是目录没对。重新检查目录后成功。所以,正确方法是打印出真正的错误原因

谷歌了很多,最后发现只有打印出真正的错误原因才可以解决。这是真的可以解决方法

@Tao-Han
Copy link

Tao-Han commented Aug 17, 2020

Because tensorflow has no logging
The traceback error: AttributeError: module 'tensorflow' has no attribute 'logging'
So downgrade the version.

@Sarvash
Copy link

Sarvash commented Jan 31, 2021

My issue was with the pre-trained model I was trying to use. Check whether you get the same error with the original pre-trained BERT models.

@temberature
Copy link

For those who are on a CPU: Follow these two steps if you're getting the same error.

  1. pip uninstall current_version_of_tf
  2. pip install tensorflow==1.13.0rc1

pip install tensorflow==1.13.1 also ok

@leren123
Copy link

leren123 commented Sep 26, 2022

hello,

greetings to all... i tried to activate BERT and this is what i've got :

(base) C:\Users\r>conda activate bert_server_test

(bert_server_test) C:\Users\r>bert-serving-start -model_dir E:\uncased_L-12_H-768_A-12\uncased_L-12_H-768_A-12\ -num_worker=1 -cpu
2022-09-27 00:08:50.944272: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-09-27 00:08:50.944453: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
C:\Users\r.conda\envs\bert_server_test\lib\site-packages\bert_serving\server\helper.py:176: UserWarning: Tensorflow 2.4.0 is not tested! It may or may not work. Feel free to submit an issue at https://github.com/hanxiao/bert-as-service/issues/
'Feel free to submit an issue at https://github.com/hanxiao/bert-as-service/issues/' % tf.version)
usage: C:\Users\r.conda\envs\bert_server_test\Scripts\bert-serving-start -model_dir E:\uncased_L-12_H-768_A-12\uncased_L-12_H-768_A-12\ -num_worker=1 -cpu
ARG VALUE


       ckpt_name = bert_model.ckpt
     config_name = bert_config.json
            cors = *
             cpu = True
      device_map = []
   do_lower_case = True

fixed_embed_length = False
fp16 = False
gpu_memory_fraction = 0.5
graph_tmp_dir = None
http_max_connect = 10
http_port = None
mask_cls_sep = False
max_batch_size = 256
max_seq_len = 25
model_dir = E:\uncased_L-12_H-768_A-12\uncased_L-12_H-768_A-12
no_position_embeddings = False
no_special_token = False
num_worker = 1
pooling_layer = [-2]
pooling_strategy = REDUCE_MEAN
port = 5555
port_out = 5556
prefetch_size = 10
priority_batch_size = 16
show_tokens_to_client = False
tuned_model_dir = None
verbose = False
xla = False

I:←[35mVENTILATOR←[0m:freeze, optimize and export graph, could take a while...
2022-09-27 00:08:53.953735: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-09-27 00:08:53.953890: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
C:\Users\r.conda\envs\bert_server_test\lib\site-packages\bert_serving\server\helper.py:176: UserWarning: Tensorflow 2.4.0 is not tested! It may or may not work. Feel free to submit an issue at https://github.com/hanxiao/bert-as-service/issues/
'Feel free to submit an issue at https://github.com/hanxiao/bert-as-service/issues/' % tf.version)
E:←[36mGRAPHOPT←[0m:fail to optimize the graph!
Traceback (most recent call last):
File "C:\Users\r.conda\envs\bert_server_test\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "C:\Users\r.conda\envs\bert_server_test\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\r.conda\envs\bert_server_test\Scripts\bert-serving-start.exe_main
.py", line 7, in
File "C:\Users\r.conda\envs\bert_server_test\lib\site-packages\bert_serving\server\cli_init
.py", line 4, in main
with BertServer(get_run_args()) as server:
File "C:\Users\r.conda\envs\bert_server_test\lib\site-packages\bert_serving\server_init_.py", line 71, in init
self.graph_path, self.bert_config = pool.apply(optimize_graph, (self.args,))
TypeError: 'NoneType' object is not iterable

anyone knows how to solve this issue? thank you in advance..

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

7 participants