If you go to week 7 in my diary "cannabis conundrums" I have posted pictures of male and female preflowers.
This should help you identify your plants once they enter the flowering stage - autos anywhere between 3 and 6 weeks of age and photoperiod plants will only flower if you change the lighting to 12/12, that is, 12 hours of light and 12 hours of darkness.
They will then show their gender somewhere between 1 and 3 weeks after going to 12/12.
Start them all at 18/6 and autos should start flowering around the 4th week and if not, go to 12/12 because they are probably photoperiod plants. There is no 100% way of telling their gender until they start flowering, however males usually have less branch development and females will have branches that grow outwards in sync with the plant growing upwards, but not in all cases.
Another indicator, but not 100% either, is to look at your plants at night. Females will generally have their leaves folded downwards, while males will keep their leaves more horizontal, but again, not in all cases. Switching on a light or using a flashlight briefly while they are still in vegative growth will not cause any issues, such as hermaphroditism.
The greatest risk with random seeds/bag seeds is that they will carry a dominant gene for being hermaphrodites as almost nobody grows pure male plants these days. If you are going to base your entire grow on these random seeds, I would advise against this, far better to buy some quality feminized seeds and grow a couple of the random seeds as an experiment. You certainly do not want to spend 3-5 months growing seeds that may turn into absolute garbage once flowering commences.
4 months of electricity costs to grow un-smokable (and unknown) buds is a risk I would not take!
They could also be exceptional and well worth the effort, but I certainly would not "put all my eggs in the same basket"!
Hope this helps, Organoman.