title: RuntimeError: Optimal parameters not found: Number of calls to function has reached maxfev = 800
body: <p>I have an image where I pick a randow row in it and try to fit a Gaussian curve in that row. I am using <strong>scipy.optimize curve_fit method</strong> for fitting a Gaussian. </p>
  
  <p>Picking of the randow rows are according to an array vector [10, 20, 40, 60, 100], meaning that in the first try I pick 10 randow rows (hence, 10 Gaussian fits) in that image, then, more rows are selected and so on. </p>
  
  <p>Most of time, code is working, however, sometimes I get an error (especially, when the number of rows are large: around 60 or more), which says <strong>optimal parameters are not found</strong>. </p>
  
  <p>I have found some similar posts in stackoverflow but still can not able to solve this problem. It seems like this problem appears quite often with <strong>curve_fit method</strong>. </p>