Tencent / tencent-ml-images

Largest multi-label image database; ResNet-101 model; 80.73% top-1 acc on ImageNet
Other
3.05k stars 514 forks source link

An Error when load the pretrained model? #19

Open idealboy opened 5 years ago

idealboy commented 5 years ago

when I load the pretrained model trained on ml-images(ckpt-resnet101-mlimages), an error occur as follow:

KeyError: u'TfplusAllreduce

my loaded code is: saver = tf.train.import_meta_graph("./pretrain_model/ckpt-resnet101-mlimages/model.ckpt.meta") saver.restore(sess, "./pretrain_model/ckpt-resnet101-mlimages")

my tensorflow version is 1.10.0

thank you for your advision, sincerely!

wubaoyuan commented 5 years ago

@idealboy Maybe you should try "saver = tf.train.Saver(tf.global_variables()) saver.restore(sess, FLAGS.model_dir)". Please refer to image_classification.py and image_classification.sh for details.

PapaMadeleine2022 commented 5 years ago

get the same error. my tensorflow version is 1.6

nxgych commented 5 years ago

same error, my tf version is 1.10.0

nxgych commented 5 years ago

@idealboy Maybe you should try "saver = tf.train.Saver(tf.global_variables()) saver.restore(sess, FLAGS.model_dir)". Please refer to image_classification.py and image_classification.sh for details.

I try,but fail

xyy19920105 commented 5 years ago

I have the same error

xxllp commented 5 years ago

有谁解决了这个问题吗

cherry0619 commented 4 years ago

I downloaded the pretrained-checkpoint and figured out the checkpiont-file absenced, then I manually created a checkpoint file with the following code, it works!! ###################### ckpt =tf.train.get_checkpoint_state(checkpoint_dir) sess = tf.Session() saver = tf.train.Saver(tf.global_variables()) if ckpt and ckpt.model_checkpoint_path: saver.restore(sess,ckpt.model_checkpoint_path) ##################### my ENV: linux tensorflow-gpu==1.13.1 python==3.6.3