JiahuiYu / neuralgym

Deep Learning Toolkit
MIT License
101 stars 97 forks source link

'tensorflow._api.v2.image' has no attribute 'resize_bilinear' #16

Open SvSz opened 3 years ago

SvSz commented 3 years ago

File "/usr/local/lib/python3.6/dist-packages/neuralgym/ops/layers.py", line 115, in func=tf.image.resize_bilinear, name='resize'): AttributeError: module 'tensorflow._api.v2.image' has no attribute 'resize_bilinear'

It concerns are placed here:

114    def resize(x, scale=2, to_shape=None, align_corners=True, dynamic=False,
115              func=tf.image.resize_bilinear, name='resize'):

I tried Tensorflow 2.0 , 2.1 and 2.4.1

Is the problem only mine or will an update according to the link below help?

https://www.tensorflow.org/api_docs/python/tf/compat/v1/image/resize_bilinear

sahasraa commented 2 years ago

Hi, even i am facing the same issue, please do help if got any leads. The error i get is, AttributeError: module 'tensorflow._api.v2.image' has no attribute 'resize_bilinear'

i trained my original .h5 model on EAST architecture of TD on tf 1.14. trying to quantize this model. quantization is only supported in tf2x.

sahasraa commented 2 years ago

Hi @fchollet could u please help me solve the issue. AttributeError: module 'tensorflow._api.v2.image' has no attribute 'resize_bilinear'

kaloomte commented 2 years ago

@sahasraa According to TensorFlow Core v2.7.0 docs you should use tf.compat.v1.image.resize_bilinear instead of tf.image.resize_bilinear.