DeepHash icon indicating copy to clipboard operation
DeepHash copied to clipboard

AttributeError: module 'tensorflow' has no attribute 'placeholder_with_default'

Open a0wsxz9 opened this issue 4 years ago • 2 comments

Hello,there was a issue when I tried running the example. DTQ:

Traceback (most recent call last): File "train_val_script.py", line 74, in model_weights = model.train(train_img, database_img, query_img, args) File "C:\DeepHash-master\DeepHash-master\DeepHash\model\dtq_init_.py", line 5, in train model = DTQ(config) File "C:\DeepHash-master\DeepHash-master\DeepHash\model\dtq\dtq.py", line 24, in init self.stage = tf.placeholder_with_default(tf.constant(0), []) AttributeError: module 'tensorflow' has no attribute 'placeholder_with_default'

DCH:

Traceback (most recent call last): File "train_val_script.py", line 61, in model_weights = model.train(train_img, database_img, query_img, args) File "C:\DeepHash-master\DeepHash-master\DeepHash\model\dch_init_.py", line 5, in train model = DCH(config) File "C:\DeepHash-master\DeepHash-master\DeepHash\model\dch\dch.py", line 29, in init self.stage = tf.placeholder_with_default(tf.constant(0), []) AttributeError: module 'tensorflow' has no attribute 'placeholder_with_default'

Is it because of my tensorflow's version?

And another thing,can I get the intermediate hash value from the model? I'm studying the secure scheme of image retrieve based on hash of hamming space.I want to use these models to make sure the precision, but I don't know if I could.I'd appreciate some help!

a0wsxz9 avatar Apr 13 '20 15:04 a0wsxz9

well,I found it is because my tensorflow version is 2.1. I want to know what the tensorflows's version well done is.

a0wsxz9 avatar Apr 14 '20 09:04 a0wsxz9

Had the same error. Changed tensorflow version to 1.14 and it worked. Hope it helps!

Riya-11 avatar Feb 25 '21 19:02 Riya-11