New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mobilenet v1 with cifar10 unexpected behavior #21058
Comments
I have figured out issue is due to the slim.batch_norm, like other people was having the same problem as well (i.e. tensorflow/models#3556) I see other people are mention training using So I am confused about the slim.batch_norm in mobilenetv1 now, should I set the is_training to True in eval? or is there anything else that I am missing? |
Hello @xiao1228, I had a similar error and I found out that I didn't save the moving mean and moving variance variables from slim.batch_norm after training, so I couldn't use is_training=False |
Thank you @NPetsky You are right it is due to the moving mean & variance. I find another way to solve it by just adding |
Good question, example code is supposed to work without code manipulation :) |
Yea, everything seems to work fine with |
System information
Hi,
I am using mobilenet_v1_eval code, instead of the imagenet dataset, i change the data to cifar10 training from scratch. The only change for the architecture is 1st conv layer with stride 1 instead of 2.
_CONV_DEFS = [
Conv(kernel=[3, 3], stride=1, depth=32),
DepthSepConv(kernel=[3, 3], stride=1, depth=64),
DepthSepConv(kernel=[3, 3], stride=2, depth=128),
DepthSepConv(kernel=[3, 3], stride=1, depth=128),
DepthSepConv(kernel=[3, 3], stride=2, depth=256),
DepthSepConv(kernel=[3, 3], stride=1, depth=256),
DepthSepConv(kernel=[3, 3], stride=2, depth=512),
DepthSepConv(kernel=[3, 3], stride=1, depth=512),
DepthSepConv(kernel=[3, 3], stride=1, depth=512),
DepthSepConv(kernel=[3, 3], stride=1, depth=512),
DepthSepConv(kernel=[3, 3], stride=1, depth=512),
DepthSepConv(kernel=[3, 3], stride=1, depth=512),
DepthSepConv(kernel=[3, 3], stride=2, depth=1024),
DepthSepConv(kernel=[3, 3], stride=1, depth=1024)
]
Training was no problem, loss decrease and prediction seems good. But in the evaluation, I use the same code as the mobilenet_v1_eval with input data as cifar10, I am gettting the same output for each image I pass in to the model. I have double checked the my input is definitely different every time, but it is very weird to get an exact same output for different images.
[[-0.11333117 -0.5380551 0.18907356 0.7664664 0.07711207 0.04618246
0.13568665 0.1360816 -0.36744678 -0.33176792]]
[[-0.11333117 -0.5380551 0.18907356 0.7664664 0.07711207 0.04618246
0.13568665 0.1360816 -0.36744678 -0.33176792]]
[[-0.11333118 -0.5380551 0.18907356 0.7664664 0.07711206 0.04618246
0.13568665 0.1360816 -0.36744678 -0.33176792]]
[[-0.11333118 -0.5380551 0.18907356 0.7664664 0.07711206 0.04618246
0.13568665 0.1360816 -0.36744678 -0.33176792]]
[[-0.11333118 -0.5380551 0.18907356 0.7664664 0.07711206 0.04618246
0.13568665 0.1360816 -0.36744678 -0.33176792]]
Please help, any suggestion will be helpful! Thank you in advance!
The text was updated successfully, but these errors were encountered: