python - How can I change device used of theano -
i tried change device used in theano-based program.
from theano import config config.device = "gpu1"
however got error
exception: can't change value of config parameter after initialization!
i wonder best way of change gpu gpu1 in code ?
thanks
there no way change value in code running in same process. best have "parent" process alters, example, theano_flags
environment variable , spawns children. however, method of spawning determine environment children operate in.
note there no way in way maintains process's memory through change. can't start running on cpu, work values stored in memory change running on gpu , continue running using values still in memory earlier (cpu) stage of work. process must shutdown , restarted change of device applied.
as import theano
device fixed , cannot changed within process did import.
Comments
Post a Comment