Open ejcgt opened 4 years ago
Same issue!
Hi @ejcgt, can you confirm if this issue still happens on latest version?
I have the same issue, as @teijeong suggested I tried with both versions:
with tensorflow_model_optimization
v.0.5.0 I get the same error mentioned before
TypeError: tf__call() got an unexpected keyword argument 'y'
with tensorflow_model_optimization
v.0.5.1, I get the following error:
File "/home/anaconda3/envs/TF/lib/python3.8/site-packages/tensorflow/python/ops/math_ops.py", line 1561, in _add_dispatch
y = ops.convert_to_tensor(y, dtype_hint=x.dtype.base_dtype, name="y")
AttributeError: 'list' object has no attribute 'dtype'
The error seems to be related, as before, to the Lambda layers.
I am using TensorFlow 2.6 with Python 3.8.8 within an anaconda environment. (Similar issue: https://github.com/tensorflow/tensorflow/issues/50079)
I can reproduce it both in MobileNetV3Small and MobileNetV3Large. It is probably because some data is list
type but tfmod assumes it is tensorflow.python.framework.ops.Tensor
or tensorflow.python.keras.engine.keras_tensor.KerasTensor
.
Has anyone been able to find a solution?
I met the same issue and ended up replacing MobileNetV3-Small with EfficientNet-lite0 which fully supports PTQ and QAT. (Also I saw big quantization error from SE blocks of MoblieNetV3-Small)
Describe the bug
tensorflow_model_optimization.quantization.keras.quantize_model function throws the following error with mobilenet v3.
System information
TensorFlow version (installed from source or binary): 2.4.0-dev20200914.
TensorFlow Model Optimization version (installed from source or binary): 0.5.0.
Python version: 3.8.5
Describe the expected behavior Code runs without crashing
Describe the current behavior Runtime error
Code to reproduce the issue
Additional context I'm trying to quantize MobileNetV3 but ran into this issue. Please help! Thank you.