Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
a0wsxz9 opened this issue Apr 13, 2020 · 2 comments

Comments

@a0wsxz9
Copy link

a0wsxz9 commented Apr 13, 2020

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
Copy link
Author

a0wsxz9 commented Apr 14, 2020

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

@Riya-11
Copy link

Riya-11 commented Feb 25, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants