Herding behaviour in stock markets leads a group of investors to imitate others and make the same economic decisions as other market participants, causing excess market volatility and price instability. This paper aims to test for the herding behaviour in different energy sectors of Chinese Stock Exchange. Firstly, Generalized Capital Asset Pricing Model (GCAPM) is employed to observe the stocks in energy sectors during financial crisis, which can test for the nonlinear relationship between return of particular portfolio and the average return of market. The empirical results indicate the presence of herding behaviour in energy sectors. Secondly, artificial neural networks are used to predict the herding behaviour in Chinese stock markets. It is advisable that during the periods when the stock market is unstable, investors should keep awake to avoid herding behaviour.