Computational hydraulics models are used extensively in both academic research and practice to study for example hydrodynamics, sediment transport, and flooding in rivers and streams. These models have many parameters, both numerical and physical, which control the accuracy and fidelity of their results. It is of great importance to set proper values for these model parameters. Inversion, or parameter estimation, is one approach to estimate the parameter values based on observation data or simulated results. One hindering problem in inversion is the need of running expensive physics-based models (PBMs) many times. In this work, we show the use of fast surrogate, instead of expensive PBMs, to perform inversion. The surrogate is constructed with a convolutional autoencoder. A gradient-based optimization was used to perform inversion with the automatic differentiation permitted by the surrogate. As in all other inversion problems, proper regularizations are necessary to obtain useable results. We demonstrate the application of our method on the inversion of river bathymetry with surface flow information. The general method can be used to invert any other parameters in computational hydraulics models.