tobegit3hub / simple_tensorflow_serving

Generic and easy-to-use serving service for machine learning models
https://stfs.readthedocs.io
Apache License 2.0
757 stars 195 forks source link

TypeError: int() argument must be a string, a bytes-like object or a number, not 'DType' #63

Open Single430 opened 5 years ago

Single430 commented 5 years ago

Error


File "./gen_client/gen_client.py", line 76, in gen_tensorflow_client
if dtype == int(tf.int8) or dtype == int(tf.uint8) or dtype == int(

TypeError: int() argument must be a string, a bytes-like object or a number, not 'DType'


> change

```python
dtype = input_opname_dtype_map[opname]
if dtype in [6, 4, 5, 17, 3, 22]:
    default_value = 1
elif dtype in [9, 23]:
    default_value = 1
elif dtype in [3]:
    default_value = True
elif dtype in [7]:
    default_value = ""
# if dtype == int(tf.int8) or dtype == int(tf.uint8) or dtype == int(
#     tf.int16) or dtype == int(tf.uint16) or dtype == int(
#         tf.int32) or dtype == int(tf.uint32):
#   default_value = 1
# elif dtype == int(tf.int64) or dtype == int(tf.uint64):
#   default_value = 1
# elif dtype == int(tf.int32):
#   default_value = True
# elif dtype == int(tf.string):
#   default_value = ""

result

GaoQ1 commented 4 years ago

i met the same problem. and didn't generate client.py file

Single430 commented 4 years ago

@GaoQ1 file path is: simple_tensorflow_serving/gen_client/gen_client.py