ry / tensorflow-resnet

ResNet model in TensorFlow
MIT License
1.66k stars 625 forks source link

New variables generated in moving_averages can't be assigned by caffe-model #38

Open asmartsnail opened 6 years ago

asmartsnail commented 6 years ago

The Issue is caused by a variable named "scale1/scale1/moving_mean/biased" which is generated in moving_average of bn.This variable has no corresponding value in caffe。I change "vars_to_restore = tf.all_variables()" to "vars_to_restore = tf.trainable_variables()".It works but the test result has great difference between tensorflow and caffe whether adding the function "_imagenet_preprocess" or not .Even in caffe and by the tensorflow meta and ckpt file provided by the author,I input the picture "cat.jpg",the output of Top5 is as follows: image image

This is obviously the wrong result。what's wrong it? In addition,After using the function "tf.trainable_variables()",an error occurs when I restore from the files .meta and .ckpt produced by the file convert.py. NotFoundError (see above for traceback): Key scale1/moving_mean not found in checkpoint Does anyone have a successful conversion?

Jamie0813 commented 6 years ago

I met the same problem