Volatility for financial assets returns can be used to gauge the risk for financial market. We propose a deep stochastic volatility model (DSVM) based on the framework of deep latent variable models. It uses flexible deep learning models to automatically detect the dependence of the future volatility on past returns, past volatilities and the stochastic noise, and thus provides a flexible volatility model without the need to manually select features. We develop a scalable inference and learning algorithm based on variational inference. In real data analysis, the DSVM outperforms several popular alternative volatility models. In addition, the predicted volatility of the DSVM provides a more reliable risk measure that can better reflex the risk in the financial market, reaching more quickly to a higher level when the market becomes more risky and to a lower level when the market is more stable, compared with the commonly used GARCH type model with a huge data set on the U.S. stock market.