Spectral CT can provide accurate tissue composition measurements by utilizing the energy dependence of x-ray attenuation in different materials. We have introduced image reconstruction and material decomposition algorithms for multi-energy CT data acquired either with energy integrating detectors (EID) or photon counting detectors (PCD); however, material decomposition is an ill-posed problem due to the potential overlap of spectral measurements and to noise. Recently, convolutional neural networks (CNN) have generated excitement in the field of machine learning and computer vision. The goal of this work is to develop CNN-based methods for material decomposition in spectral CT. The CNN for decomposition had a U-net structure and was trained with either five-energy PCD-CT or DE-CT. As targets for training, we used simulated phantoms constructed from random combinations of water and contrast agents (iodine, barium, and calcium for five-energy PCD-CT; iodine and gold for DE EID-based CT). The experimentally measured sensitivity matrix values for iodine, barium, and calcium or iodine and gold were used to recreate the CT images corresponding to both PCD and DE-CT cases. These CT images were used to train CNNs to generate material maps at each pixel location. After training, we tested the CNNs by applying them to experimentally acquired DE-EID and PCD-based micro-CT data in mice. The predicted material maps were compared to the absolute truth in simulations and to sensitivity-based decompositions for the in vivo mouse data. The CNN-based decomposition provided higher accuracy and lower noise. In conclusion, our U-net performed a more robust spectral micro-CT decomposition because it inherently better exploits spatial and spectral correlations.