Skip to content

Commit

Permalink
Merge pull request #779 from JiabinYang/change_device
Browse files Browse the repository at this point in the history
fix change device error code
  • Loading branch information
amcadmus authored Jun 22, 2021
2 parents 4b24e1f + 9a92b7f commit 55670b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deepmd/train/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ class DPTrainer (object):
def __init__(self,
jdata,
run_opt):
paddle.set_device("cpu")
self.run_opt = run_opt
self._init_param(jdata)

Expand Down Expand Up @@ -304,7 +305,7 @@ def build (self,
def train (self,
data,
stop_batch) :
paddle.set_device("gpu")

self.stop_batch = stop_batch

self.print_head()
Expand Down

0 comments on commit 55670b2

Please sign in to comment.