Predicting binding affinities between small molecules and the protein target is at the core of computational drug screening and drug target identification. Deep learning-based approaches have recently been adapted to predict binding affinities and they claim to achieve high prediction accuracy in their tests; we show that these approaches do not generalize, that is, they fail to predict interactions between unknown proteins and unknown small molecules. To address these shortcomings, we develop a new compound-protein interaction predictor, Yuel, which predicts compound-protein interactions with a higher generalizability than the existing methods. Upon comprehensive tests on various data sets, we find that out of all the deep-learning approaches surveyed, Yuel manifests the best ability to predict interactions between unknown compounds and unknown proteins.