pudae / tensorflow-densenet

Tensorflow-DenseNet with ImageNet Pretrained Models
Apache License 2.0
169 stars 59 forks source link

How to use eval_image_classifier.py to predict my images? #8

Closed phybrain closed 6 years ago

phybrain commented 6 years ago

I'm not very familiar with this code enough,can you help me?

pudae commented 6 years ago

Here is sample code. link Usage: python predict_image.py --image=./sample_image.jpg --checkpoint_path=./tf-densenet121.ckpt

mit10000 commented 6 years ago

Pudae, Thanks for sharing. One further question. In your code, the output logits is defined by

logits, _ = network_fn(images)

In deployment, if we don't want to disclose network_fn source codes, instead we use

logits=tf.get_default_graph().get_tensor_by_name('densenet169/logits/BiasAdd:0')

We can do prediction, but the results are different. Could you please tell what cause this problem?