Aim. Segmentation of the right and left ventricular (RV, LV) myocardium (Myo) on cine (CMR) images represents an essential step for cardiac function evaluation and diagnosis. To have a common reference for comparison of performance for processing algorithms, several CMR image databases are available, but generally they do not include the most apical and basal slices, and/or gold standard tracing is limited to only one of the two ventricle. Our aim was to develop a deep learning (DL) approach for automatic segmentation of both RV and LV myocardium from short-axis (SAX) CMR images, including all the clinically relevant slices. Method. A database of retrospectively selected 210 studies (3 pathology groups) was considered: Images were acquired and manually segmented (gold standard, GS) at Centro Cardiologico Monzino (Milan, Italy). The database was randomly divided into training, validation and testing sets (70%, 15% and 15%, respectively). Image segmentation was performed with U-Net inspired architecture, where two loss functions were used: weighted cross entropy (WCE) and its combination with a dice loss function (WCE + Dice). Online data augmentation was used. Two experiments were conducted: E1) all the slices were analyzed; E2) basal slices which GS contours did not follow current guidelines for identification of the basal slice were removed. To evaluate the best performing method, in a post-hoc analysis the predicted segmentations were reviewed by an expert physician. Results. For both the experiments, WCE generally performed better, with mean Dice coefficients of 0.941 (LV), 0.901 (RV) and 0.844 (Myo) in E1, and 0.944 (LV), 0.908 (RV), and 0.851 (Myo) in E2. Conclusions. Our results support the potential of DL methods for accurate and reproducible segmentation of CMR images. Accurate contours of basal slices represent a challenge due to the high variability of the manual segmentation that could benefit from specific algorithm training.