How to detect number of specific object in an image and it's diameter(size)?
Well to answer your last question, you cannot train with the images that you want to test your algorithm with, that is a paradox...

You will need more than just two images if you want to build a robust model that can detect each rod AND predict their diameter. Those are two different problems, and you might want to split your model in two branches: one to detect each rod, the other to predict its diameter as a regression problem.

If you can obtain a larger dataset with ground truth, then you can proceed to train your model. I would tend to say that using an object detector CNN would be overkill, but if you need to predict the diameter of each rod in the image, it might be necessary. So maybe look into TinyYOLO for the detection part, and then you could use the predict bounding box of each rod in the image for a small perceptron to infer the diameter.