ry / tensorflow-resnet

ResNet model in TensorFlow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

asmartsnail opened this issue · comments

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?

I met the same problem