In the model $Y_i = g(t_i) + \varepsilon_i,\quad i = 1,\cdots, n,$ where $Y_i$ are given observations, $\varepsilon_i$ i.i.d. noise variables and $t_i$ nonrandom design points, kernel estimators for the regression function $g(t)$ with variable bandwidth (smoothing parameter) depending on $t$ are proposed. It is shown that in terms of asymptotic integrated mean squared error, kernel estimators with such a local bandwidth choice are superior to the ordinary kernel estimators with global bandwidth choice if optimal bandwidths are used. This superiority is maintained in a certain sense if optimal local bandwidths are estimated in a consistent manner from the data, which is proved by a tightness argument. The finite sample behavior of a specific local bandwidth selection procedure based on the Rice criterion for global bandwidth choice [Rice (1984)] is investigated by simulation.