The convolutional neural network (CNN) is implemented to enhance a turbulence model which is needed to close the Reynolds-averaged Navier-Stokes (RANS) equations. The machine-learning technique uses the available data sets of high fidelity for canonical flow test cases. These data have been produced from large-eddy simulations or direct numerical simulations, which require huge computing resources. At the first stage, the widely used k-? model is taken as a baseline RANS model, and computations are performed by means of OpenFOAM for turbulent flows in the plane channel having the periodic hills on the lower wall and in the converging-diverging channel. Then, the CNN algorithm is applied to these cases. The prediction of the Reynolds-stress anisotropy tensor components is shown to be improved after the application of CNN with the mean square error loss function in comparison with that for the baseline RANS model in the investigated canonical turbulent flows in channels with walls of different geometry.