-
Notifications
You must be signed in to change notification settings - Fork 3
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
Cannot load pretrained weights into a modified network #6
Comments
I did not check, but I guess
|
That's strange because in PyTorch with the same network, optimizer, parameters and loss, 4 channels (RGB+Depth) gives better results than just 3 (RGB only) and that's what's expected, but with your code in tensorflow accuracy is lower with 4 channels...I think I will have no choice but to compare in PyTorch and extrapolate from there... |
This issue should not be closed because your code still don’t work with RGB+D concatenation...It should work like in pytorch (improve the performance and not decreasing them). |
Hi. This code refers to our paper. We never ever perform rgb+d concatenation there. I have been happy to help you with your code, but I cannot be in charge of solving issues with your modified version of my code. |
Ok but do you have any idea how its possible that your code gives lower performances with RGB+Depth concatenate than just RGB and Depth while in PyTorch its better ? |
There can be many reasons I think
Hope this is useful. |
Thanks a lot I’m gonna check all those possible issues, when the problem will be solved I will write de solution here! |
Following the issue #5 (now the problem is with the loading of the pretrained weights)
I'm able to assign a tensor...and load the value contain in the checkpoints, but... But it's seem I still have some problems...
Code 1 (saving the pretrained weight in numpy, line variables_to_restore = [vv for vv in variables_to_restore if 'conv1' not in vv.name] not active):
Code 2 (assigning the pretrained weights) :
So I made those verifications:
This print exactly the value expected, it contain the pretrained weights. So that's ok.
But after executing the block Code 2 to assign te pretrained weights to the convolution initialized randomly I do:
I get exactly the randomly initialized weights from before that block of code and not the pretrained ones...the assign dont have any effect on the trainable_variables
The problem, because it's seem I dont have any effect on the trainable_variables, must be with :
vars = tf.trainable_variables()
vars_vals = sess.run(vars)
According to some person on Stack_Overflow: ass=sess.run(var) and sess.run(ass) at the end of block Code 2, that resolve that, the transfer is ok for the weights of conv1.
Or do you think that variables_to_restore = [vv for vv in variables_to_restore if 'conv1' not in vv.name] also affect variable like rgb/resnet_v1_50/block3/unit_3/bottleneck_v1/conv1/weights:0 (float32_ref 1x1x1024x256) [262144, bytes: 1048576] because of the conv1...? I changed it for variables_to_restore = [vv for vv in variables_to_restore if 'rgb/resnet_v1_50/conv1/weights' not in vv.name] so it's suppose to be exactly the same weights and it's working. But I still have weird thing happening...
The text was updated successfully, but these errors were encountered: