wenxinxu/resnet-in-tensorflow

load checkpoint

nicegdhj opened this issue · 4 comments

Can I load checkpoint model_110.ckpt-79999 into ResNet-32?

感谢您的分享
有个问题我不太明白,想请教
我使用您的的代码,设定
num_residual_blocks =5 (32层)
load checkpoint model_110.ckpt-79999
之后继续在在cifar 10的数据集上训练了2000 次
top-1 错误率 为什么会在15%左右?
难道不应该是 7%左右码?

Hi,

As I mentioned in the user's guide, the number of layers equals to (6 * num_residual_blocks + 2). The checkpoint_model_110 was trained for ResNet-110, and should be loaded into a model with 18 residual blocks.

If it's loaded into ResNet-32, you'll only have the lower-level weights of the full model. That's why it does not perform as well as a complete model.

Sorry that I did not reply in Chinese. I just hope that other users who have the same issue could also find a solution here :)

thanks
I want to use this project to perform my own tasks,which the size of image should be 256*256 or larger and the number of final classification categories is 4 .
should I just modify a few simple parameters on it,such as, IMG_WIDTH ,IMG_HEIGHT,NUM_CLASS,or that I need to reset the parameters of almost all network layers ?

In my opinion, you'd better resize the images to 32*32 first and then feed into the network. To modify the number of classes to 4, you need to change line 195 in resnet.py and line 21 in cifar10_input.py. Then it should be good to go. (I hard coded the number of classes, as this tutorial was originally designed merely for cifar10...)

From my experience, the code should somehow work with your images, but maybe not as good as ResNet for ImageNet. You'll lose many features in resizing. Anyway, there is no harm to start with this one.

thanks!