Background: Glass and rubbery transitions under cooling and heating of polymeric materials underlie a shape memory effect, that is a material ability to save temporarily the deformed shape and restore the original one under the external influence. The present work aims to model the shape memory effect for an axially compressed polymeric rod in its post-buckled equilibrium state, which is the generalization of Euler's elastica for a glassy material case. Methods: For modeling, we use a new type of constitutive relations describing the thermomechanical behavior of amorphous polymers over a wide temperature range. To define the model parameters for lightly-linked epoxy resin a series of experiments was conducted using the Dynamic Mechanical Analyzer. Results: Post-buckled states of an epoxy rod equilibrium during the temperature change have been found from numerical simulation. The obtained results illustrate the shape memory effect in case of axially compressed rod buckling. Conclusion: The thermomechanical shape-memory cycle includes the stages of deformation development and preservation and the subsequent recovery of the initial shape. According to the obtained results, maximum deflection corresponds to the first loading step at the rubbery material state, because the elastic modulus is very low. During cooling under a constant load the deformation remains constant. After unloading in glassy state the deflection decreases by a small value, because the glassy elastic modulus significantly exceeds the rubbery one. During subsequent heating the rod recovers its initial undeformed shape.