Cochrane was born in Kirklands, Galashiels, Scotland, into a family he described as "industrial upper middle class". His father was killed whilst serving with the King's Own Scottish Borderers during World War I. He won a scholarship to Uppingham School, and obtained another scholarship to King's College, Cambridge, achieving first class honours in Parts I and II of the Natural Sciences Tripos and completing 2nd MB studies in physiology and anatomy in 1930. He qualified in 1938 at University College Hospital, London, at University College London.