You have to remove training nodes before converting variables to constant. import os import os.path as osp import argpa