# How to pick length-scale bounds for RBC kernels in Gaussian Process Regression?

I am trying to fit GP regression models to several thousand $x, y$ pairs independantly. I am using Python's sklearn implementation with a constant kernel plus an RBF kernel plus a white noise kernel. Usually it goes well and I get good results (red is the function, blue the GPR predictions):

However sometimes it doesn't work. I get an error message saying the L-BFGS-B optimizer terminated in an abnormal state. The problem seems to be the bounds of the length scale in the RBF kernel. In the image above it was between $10^{-1}$ and $10^2$. If I change the upper bound to $10^3$ the optimizer fails. If I change it to $10^4$ it works but now the function looks like this:

How do I automatically select an appropriate set of bounds?