tensorflow / tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Apache License 2.0
15.5k stars 3.49k forks source link

serving/query.py 'tensorflow' has no attribute 'bytes' #1611

Open JakubSido opened 5 years ago

JakubSido commented 5 years ago

Description

When using query.py from serving the following appears. It looks like tensorflow' has no attribute 'bytes'. What does it mean?

Traceback (most recent call last):

  File "C:/Program Files/Python37/Lib/site-packages/tensor2tensor/serving/query.py", line 119, in <module>
    tf.app.run()
  File "C:\Users\Jakub\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\platform\app.py", line 125, in run
    _sys.exit(main(argv))
  File "C:/Program Files/Python37/Lib/site-packages/tensor2tensor/serving/query.py", line 90, in main
    outputs = serving_utils.predict([inputs], problem, request_fn)
  File "C:\Program Files\Python37\lib\site-packages\tensor2tensor\serving\serving_utils.py", line 159, in predict
    for input_ids in input_ids_list]
  File "C:\Program Files\Python37\lib\site-packages\tensor2tensor\serving\serving_utils.py", line 159, in <listcomp>
    for input_ids in input_ids_list]
  File "C:\Program Files\Python37\lib\site-packages\tensor2tensor\serving\serving_utils.py", line 75, in _make_example
    if ftype.dtype == tf.bytes:
AttributeError: module 'tensorflow' has no attribute 'bytes'

...

Environment information

OS: win10

$ pip freeze | grep tensor
tensor2tensor==1.13.2
tensorboard==1.13.1
tensorflow-datasets==1.0.1
tensorflow-estimator==1.13.0
tensorflow-gpu==1.13.1
tensorflow-hub==0.4.0
tensorflow-metadata==0.13.0
tensorflow-probability==0.6.0
tensorflow-serving-api==1.13.0

$ python -V
Python 3.7.3

# Steps to reproduce:
python query.py --t2t_usr_dir=... --server=localhost:8500 --servable_name=...  --problem=...  --data_dir=...
>>0               
manuel3265 commented 5 years ago

what model you trained?

JakubSido commented 5 years ago

It was transformer-encoder or seq2seq-encoder.

RoeeRephraser commented 5 years ago

Not sure that's the cause of this but query.py is Py2 only.