I train different models with tensor object detection (TFOD) API and I would like to know how many parameters are trained for a given model.
I run faster RCNN, SSD, RFCN and also with different image resolution, I would like to have a way to know how many parameters are trained. Is there a way to do that?
I have tried answers found here How to count total number of trainable parameters in a tensorflow model? with no luck.
Here is the code I added line 103 of model_main.py
:
print("Training {} parameters".format(np.sum([np.prod(v.get_shape().as_list()) for v in tf.trainable_variables()]))
I think the problem is that I do not access the tf.Session() the TFOD is running, hence my code always return 0.0 parameters (although training strats just fine and train, hopefully, millions of parameters), and I don't know how to solve that issue.